-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Using ValueTuple with PackageReference on Azure Cloud Services #3551
Comments
I got exactly the same issue, but on some other packages like System.Buffers. The dlls under ref folder was copied, instead of lib folder. Is there any workaround except reverting back to Reference? @jnyrup how did you get around it? |
@zhaomuzhi I got around the problem in my toy project by re-targeting the projects to .net 4.7.2. To get that to run in the Cloud Services you either need to: For Guest OS Family 5, you need to install .net 4.7.2 as part of the deployment process. |
Well, this seems to be behaving as expected actually. Besides that, this does not seem to be an MSBuild issue either. 4.6.2 does not contain the assembly, therefore it needs to be acquired through nuget and distributed with the app. If you want to avoid that, you need to target a TFM where it is supported, net4.7.2, for instance. The system is doing what it is supposed to do. |
@livarcocc I've update the issue description to hopefully be more clear. |
I got the same issue, so I upgraded all projects to target 4.7.2. |
This seems like something that NuGet should/could take a look on. I am going to move this issue to NuGet. |
This issue was moved to NuGet/Home#8723 |
FYI I think neither MSBuild nor NuGet nor the Azure SDK for .NET project is the right place for this bug. |
This is the same problem as described in this closed/abandoned issue. That got closed as being reported the wrong place, that's why I'm trying here.
Please let me know if this is also not the right repo.
I'm trying to convert my C# projects from old to new csproj style, but this breaks my Azure Cloud Service at runtime because the ReferenceAssembly of
System.ValueTuple.dll
is copied instead of the implementing assembly.My projects are currently targeting .NET 4.6.1, which doesn't come with
System.ValueTuple
but should be able to get it by consuming theSystem.ValueTuple
NuGet package.The problem is "solvable" by targeting .NET 4.7+, as that comes with
System.ValueTuple
included and hence does not need to reference it as a NuGet package.I would like to avoid upgrading to .NET 4.7+ if possible, as:
This requires an additional deploy step to install .net 4.7+ runtimes on the worker roles, as they come with .net 4.6.2 installed. https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-guestos-update-matrix#family-5-releases
This seems as "the easy way out", and I would like to know if the problem can be solved otherwise.
Steps to reproduce
I'll use:
packages\system.valuetuple\4.5.0\ref\net461\System.ValueTuple.dll
, andpackages\system.valuetuple\4.5.0\lib\net461\System.ValueTuple.dll
.They are easily distinguishable, as refDLL is 40 kb and libDLL is 78 kb.
The code and complete build log file is found here:
AzureCloudService1.zip
WorkerRole1
consumesSystem.ValueTuple
viapackages.config
WorkerRole2
consumesSystem.ValueTuple
viaPackageReference
After building the cloud service the
WorkerRole1\bin\Debug
has libDLL.WorkerRole2\bin\Debug\net461
has libDLLAzureCloudService1\obj\Debug\WorkerRole1
has libDLLAzureCloudService1\obj\Debug\WorkerRole2
has refDLLExpected behavior
AzureCloudService1\obj\Debug\WorkerRole2
should contain libDLL.Actual behavior
AzureCloudService1\obj\Debug\WorkerRole2
contains refDLL.Environment data
msbuild /version
output:Addionational info
From the logs, I noticed the following difference between WorkerRole1 and WorkerRole2.
WorkerRole1:
After searching for other related issues on various Microsoft issue trackers, I found this one, which seems related: dotnet/sdk#1738.
The text was updated successfully, but these errors were encountered: