dotnet / dotnet/msbuild

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

Open
#5,335 4 comments 2 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

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`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.