Open walterlv opened 4 years ago
Probably a facet of https://github.com/dotnet/wpf/issues/2274; If I'm correct about it, this is being fixed by https://github.com/dotnet/runtime/issues/730 in an upcoming servicing release.
How to fix?
Add the global.json file and add the code
{
"sdk":
{
"version": "3.0.102"
}
}
Goto https://dotnet.microsoft.com/download/dotnet-core and download install the dotnet core 3.0.102
@vatsan-madhavan I think this issues can be closed. @walterlv
How to fix?
@lindexi you are downgrading not fixing the problem in 3.1 so this is just a workaround, if OP needs features from 3.1 this won't work for him, so it is not a general solution
@lindexi @weltkante Just wait for the 3.1.2
Just wait for the 3.1.2
…which should be out in a week (assuming nothing happens to upset that schedule 😉 )
Note that this has not been fixed with 3.1.2. See #2274 for all the details.
@GeertvanHorrik I find the 3.1.102 published.
I can confirm this has been fixed in 3.1.103, great work, thanks!
Yes! This issue has been fixed since 3.1.103.
This looks to have regressed with 3.1.400 (16.7 release)
@MatthewSteeples Yes! This issue resurrects with 3.1.400 (16.7 release).
What makes worse is that the embedded .NET Core version is newer than the .NET Core download page version here so that we cannot uninstall it to fix this issue temporarily.
The global.json still works but this makes projects unable to be compiled (via CI) a few months later, just like what I meet after this issue first occurred last year.
Note: This update (3.1.400) introduces two issues to breaks my project compilation. This one and another https://github.com/dotnet/sdk/issues/12842 .
Thank you @walterlv
It is break
Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.
Problem description:
If a WPF project uses
Microsoft.NET.Sdk.WindowsDesktop
as its Sdk, and targets lower thannet461
, then it can never be compiled when referencingSystem.ValueTuple
.Necessary conditions:
Microsoft.NET.Sdk.WindowsDesktop
Sdk andUseWpf
net46
/net452
/net451
/net45
System.ValueTuple
This issue is introduced in 3.1 and everything works fine in 3.0.
Actual behavior:
Error MC1000 Unkown build error “Could not find assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.” Walterlv.Demo.CannotCompileWithValueTuple C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets 225
Expected behavior:
The project should be compiled correctly.
Minimal repro:
System.ValueTuple
;You can view the minimal project here: