sdk: Asp.Net Core RC2 Error "Failed to make the following project runnable"
Steps to reproduce
I have a MVC project I have just upgraded to RC2 and is checked into version control. When I build the project with “dotnet build” I get an access denied error on the config file. If I checkout app.config (e.g. remove the read only flag) it will build successfully.
Expected behavior
Project should build.
Actual behavior
I get the error:
Failed to make the following project runnable: xxx (.NETFramework,Version=v4.6.1) reason: Access to the path ‘E:…\bin\Debug\net461\win7-x64\xxx.exe.config’ is denied.
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.0-preview1-002702)
Product Information: Version: 1.0.0-preview1-002702 Commit Sha: 6cde21225e
Runtime Environment: OS Name: Windows OS Version: 6.3.9600 OS Platform: Windows RID: win81-x64
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 24 (4 by maintainers)
I have the same issue. If a project references another project, the build path is computed relative and can’t find the binary file. Please provide a workaround.
I followed the link provided in the fix by @Frisch12. There is a workaround to remove the read only attribute from offending file and directory in the project.json file. I modified this to remove read only from the whole bin directory as:
"scripts": { "precompile": [ "cmd /c echo Removing read-only attributes in %project:Directory%\\bin\\ as a workaround&& cmd /c attrib -r %project:Directory%\\bin\\* /s" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] }I have the same error as @mafshin but with a different DLL. Any update on this? Perhaps we should make a separate issue for this? This error is different to the original OP’s error and has already been fixed.
I got around it by converting *.xproj project (with project.json) to plain old *.csproj (with packages.config deps). Then used this project as a start for further dependency chain.
Removing app.config fixed our issue to certain extent. We moved this app.config setting into project.json.
We are facing issue with EntityFramework.Sqlserver.dll. We have DbContext project which needs reference to EntityFramework and RepositoryProject which needs reference to EntityFramework and references DbContext project. This is when we get EntityFramework.SqlServer error mentioned above.
We have to manually remove “net461” folder under bin\Debug to compile the project every time.
Any fix?
Do you need app.config? Check https://msdn.microsoft.com/en-us/library/ms733932(v=vs.110).aspx
I had the same issue. I had file app.config in my project with the following content:
<configuration><runtime><gcServer enabled="true"/></runtime></configuration>I deleted app.config file and it works now.
@piotrpMSFT No - I’d actually like to keep the file checked in - the checkout is just a workaround to get the build to succeed. The problem is that during the build, app.config is copied and renamed to xxx.exe.config. It appears that once the file is copied, the config file is modified by dotnet to add (in my case at least) an assemblyBinding section. Since the original file was copied with the read-only flag - the build fails trying to modify a file it has created. The fix would be for dotnet to remove the read-only flag from the config file that it created and wants to modify.