Skip to content
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

Azure Cloud Service Worker Role "compile" assemblies copied from nuget package instead of "runtime" version #5335

Open
alexeizalesski opened this issue May 5, 2020 · 4 comments
Labels

Comments

@alexeizalesski
Copy link

I have azure cloud service project with worker role.
I have nuget package referenced, here is what I see in project.assets.json of my worker project:

"Microsoft.Bcl.AsyncInterfaces/1.1.0": { "type": "package", "dependencies": { "System.Threading.Tasks.Extensions": "4.5.2" }, "frameworkAssemblies": [ "mscorlib" ], "compile": { "ref/net461/Microsoft.Bcl.AsyncInterfaces.dll": {} }, "runtime": { "lib/net461/Microsoft.Bcl.AsyncInterfaces.dll": {} } },

When I build worker project then DLL from "runtime" section is properly copied to output folder, but when I build cloud service project, then DLL from "compile" section is copied to obj and csx folder of cloud project, so cloud service package contains wrong DLL as well. As a result I receive exception when run project in azure cloud emulator or on real azure cloud service:

could not load file or assembly 'microsoft.bcl.asyncinterfaces, version=1.0.0.0, culture=neutral, publickeytoken=cc7b13ffcd2ddd51' or one of its dependencies. reference assemblies should not be loaded for execution

@alexeizalesski alexeizalesski changed the title Azure Cloud Service Worker Role compile assemblies copied from buget package instead of runtime Azure Cloud Service Worker Role compile assemblies copied from nuget package instead of runtime May 5, 2020
@alexeizalesski alexeizalesski changed the title Azure Cloud Service Worker Role compile assemblies copied from nuget package instead of runtime Azure Cloud Service Worker Role "compile" assemblies copied from nuget package instead of |runtime" version May 5, 2020
@alexeizalesski alexeizalesski changed the title Azure Cloud Service Worker Role "compile" assemblies copied from nuget package instead of |runtime" version Azure Cloud Service Worker Role "compile" assemblies copied from nuget package instead of "runtime" version May 5, 2020
@rainersigwald
Copy link
Member

I'm not sure whether this is a bug in NuGet handling transitive assets or in the cloud service SDK. Do you have a repro project you can share? That could help route.

@alexeizalesski
Copy link
Author

Here is my sample solution

[AzureCloudService.Sample.zip]
(https://github.com/microsoft/msbuild/files/4587988/AzureCloudService.Sample.zip)

If you start CloudService project you will see an exception.

And as I mentioned ealrier at _AzureCloudService.Sample\WorkerRole.Sample\bin\Debug_ you may find proper runtime DLL, but here _AzureCloudService.Sample\AzureCloudService.Sample\csx\Debug\roles\WorkerRole.Sample\approot_ you will find "referrence assembly" DLL which is not working.

@extragen
Copy link

@alexeizalesski have you found a solution?

@extragen
Copy link

found workaround here Azure/azure-sdk-for-net#3699 (comment)

@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants