-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASP.NET MVC fails with "Cannot find compilation library location for package 'Microsoft.Win32.Registry'" on Ubuntu #2701
Comments
Root cause suspected to be dotnet/sdk#1130. CC: @eerhardt |
Fixing now. |
PR up to fix this: dotnet/sdk#1134. Will need to get that merged into dotnet/sdk and then that build merged into dotnet/cli. |
This is fixed by above PR |
Verified fixed in the latest ASP.NET builds. |
@eerhardt / @mikeharder I'm seeing the same error ('Cannot find compilation library location for package <package-name>') with a barebones MVC under Windows, when I reference a DLL file in the web app. Do you think that is addressed by the fix as well? Note that the DLL is just a file, not a NuGet package, and by the error text it sounds like something is trying to treat it as a package. It seems that it happens for an MVC web app (not an Empty one), when targeting netcoreapp2.0 or net461. EDIT: same results using |
Hi, I'm receiving this error when I try to deploy to Azure. I'm referencing the stable build .NET Core 2.0 SDK, I think. I had no problems running it locally, but now this error is getting thrown on Azure. I don't know why this is happening or how to fix it. Can anyone help? |
Have the same issue as @scout208 Full stacktrace:
|
Can you share what your .csproj looks like? |
|
I'm trying to see where the rabbithole leads, so been adding the missing assemblies to a copy of what got deployed to Azure one by one, these are the assemblies missing. These are the assemblies:
But then the next one is the Microsoft.NETCore.App package itself....
|
PS, the above csproj also does not work without the following.
|
Link to project. For completeness I am on VS2017 15.4.0, preview 6.0 |
@colindekker - I took the app you provided in your link and published it to an azure app service: http://myassembly20171012100507.azurewebsites.net/. It seems to be working for me. The one thing I had to do to the app was commenting out the following lines: public void ConfigureServices(IServiceCollection services)
{
//services.ConfigureDataProtectionPersistence();
...
services.AddIdentityServerConfiguredForCloudscribe()
.AddCloudscribeCoreEFIdentityServerStorageMSSQL(connectionString)
.AddCloudscribeIdentityServerIntegrationMvc();
//.ConfigureIdentityServerSigningCredentials(Configuration, Environment); because I didn't set up and configure those services. I don't expect those to cause the problems. To try to debug your issue - can you The error you are reporting above is what happens when you don't have any assemblies in the Another thing to try is to create a new default ASP.NET Core MVC project and publish it to make sure it is working correctly. If that isn't working, then there are larger issues. |
I figured out what was causing my problem. @colindekker maybe this will work for yours too. In my case, it began with simply a misunderstanding of what was causing the error to be thrown. Turns out I was using the NToastNotify library which uses embedded views. @colindekker are you using any embedded views? Based on aspnet/Mvc#6021 (comment), I added Here's my new working .csproj,
|
Yes, that seems to be the issue! The cloudscribe project has embedded views
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Connor Early <[email protected]>
Sent: Tuesday, October 17, 2017 9:20:28 PM
To: dotnet/core-setup
Cc: Colin Dekker; Mention
Subject: Re: [dotnet/core-setup] ASP.NET MVC fails with "Cannot find compilation library location for package 'Microsoft.Win32.Registry'" on Ubuntu (#2113)
I figured out what was causing my problem. @colindekker<https://github.com/colindekker> maybe this will work for yours too.
In my case, it began with simply a misunderstanding of what was causing the error to be thrown. Turns out I was using the NToastNotify library which uses embedded views. @colindekker<https://github.com/colindekker> are you using any embedded views?
Based on aspnet/Mvc#6021 (comment)<aspnet/Mvc#6021 (comment)>,
I added <MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> to my .csproj and it ran just fine.
Here's my new working .csproj,
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="NToastNotify" Version="3.0.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
</Project>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://github.com/dotnet/core-setup/issues/2113#issuecomment-337341068>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGTTd2Z0CdHnU-uqqYoZQtAQeC3t2Hp2ks5stP38gaJpZM4NCHkm>.
|
@scout208 you savd my day!! I had another trouble which was also saved jst before concerning the following error here is the solution : |
I still have same, having .netcore 2.0 with VS2017 Community and added the 2 following fields in the property group : MvcRazorExcludeRefAssembliesFromPublish and MvcRazorCompileOnPublish to false. Trying to deploy with docker on Linux. But Error : Cannot find compilation library location for package 'Microsoft.Win32.Registry' . Is still there.. any help |
This issue is fixed in Asp.Net Core 2.1 |
If I run But if I run Inside the container it just works when I run This is a common scenario for debugging inside a container without having to rebuild the docker image each time the code changes, I wanted to continue debugging running just Is it the normal behavior? Why can't I run inside the container the dll built on ubuntu with |
Since It is not supported to build on one machine (outside of the docker container), and then to execute on another machine (inside the docker container). I can think of 2 ways to fix this:
|
Hi @eerhardt, Thank you for the clear explanation. In our case we started having the problem after integrating our docker containers with visual studio for debugging. As explained in their documentation, in order to provide a fast debug experience, the application are build on the host and then mounted in the container. Where it runs from the build output folder. And indeed, when comparing the output some dll's are missing:
I'll report this through the visual studio issue tracker. Kind regards, |
Steps to reproduce
Exception
grep -r DependencyModel *
dotnet/core-setup#2039 was thought to fix this, but MVC still fails after this change.
The text was updated successfully, but these errors were encountered: