-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET framework SDK projects without a RID are incorrectly passing RID specific assets to conflict resolution. #1510
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
Comments
This may not be directly related to this issue, but if .NET Core is the only thing that understands RuntimeTarget items, why does the System.Security.Cryptography.Algorithms package have a runtimeTarget item for net461? "runtimeTargets": {
"runtimes/osx/lib/netstandard1.6/System.Security.Cryptography.Algorithms.dll": {
"assetType": "runtime",
"rid": "osx"
},
"runtimes/unix/lib/netstandard1.6/System.Security.Cryptography.Algorithms.dll": {
"assetType": "runtime",
"rid": "unix"
},
"runtimes/win/lib/net461/System.Security.Cryptography.Algorithms.dll": {
"assetType": "runtime",
"rid": "win"
}
} |
That's just how nuget lists RID specific assets when restoring without a RID. The only framework that I am aware of actually uses those is .NETCore since it can do RID-selection at runtime. I suspect that the SDK already has this knowledge since it knows not to copy RID-specific assets (runtime target assets) for desktop. /cc @eerhardt |
We've had a few issues with "Desktop without a RID" scenarios. In project.json land, this wasn't really supported/implemented, as the CLI would infer a RID if you were building a Desktop project and didn't specify a RID. In the MSBuild based tools, if you are a Desktop EXE, we also infer a RID if one isn't specified. Are we expecting the output directory of a Desktop library project to be runnable/executable? What happens if the Desktop library references a NuGet package with native assets in it? ex. LibUV. Would you expect:
|
When restoring without a RID on things other than .NETCoreApp the expectation is that no RID specific assets are copied. This is the behavior of packages.config, and project.json. If folks need native assets, take Microsoft.DiaSymReader.Native, they typically will deal with that via targets. I've also seen folks with targets that will error if a RID isn't specified. |
Moving the work around @dsplaisted gave me for this issue in a linked bug <Target Name="WorkaroundConflictResolution" AfterTargets="_ComputeActiveTFMFileDependencies"
Condition="'$(PlatformTarget)' == 'AnyCPU' And '$(TargetFrameworkIdentifier)' == '.NETFramework'">
<ItemGroup>
<_ActiveTFMFileDependencies Remove="@(_ActiveTFMFileDependencies->WithMetadataValue('FileGroup', 'RuntimeTarget'))" />
</ItemGroup>
</Target> Wanted to emphasize that this is a very painful bug. Even after having a viable work around I've still spent another full day tracking down all the places that it needs to be applied. Currently hitting problems trying to get the assets to deploy inside a VSIX. Once customers hit this it's going to cause a lot of pain. |
@jeredpar I had the impression that you just put the workaround in the common Roslyn targets that would apply to the whole repo. Does that not work?
From: Jared Parsons
Sent: Thursday, August 31, 2017 4:10 PM
To: dotnet/sdk
Cc: Daniel Plaisted; Mention
Subject: Re: [dotnet/sdk] .NET framework SDK projects without a RID areincorrectly passing RID specific assets to conflict resolution. (#1510)
Moving the work around @dsplaisted gave me for this issue in a linked bug
<Target Name="WorkaroundConflictResolution" AfterTargets="_ComputeActiveTFMFileDependencies"
Condition="'$(PlatformTarget)' == 'AnyCPU' And '$(TargetFrameworkIdentifier)' == '.NETFramework'">
<ItemGroup>
<_ActiveTFMFileDependencies Remove="@(_ActiveTFMFileDependencies->WithMetadataValue('FileGroup', 'RuntimeTarget'))" />
</ItemGroup>
</Target>
Wanted to emphasize that this is a very painful bug. Even after having a viable work around I've still spent another full day tracking down all the places that it needs to be applied. Currently hitting problems trying to get the assets to deploy inside a VSIX.
Once customers hit this it's going to cause a lot of pain.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
That fixed the majority of our issues. It didn't fix our VSIX projects though and it took me a bit of debugging today to narrow down how to fix that. For those I had to do the following:
This commit demos the change I needed to make: dotnet/roslyn@732d5f6 It's quite possible (2) wasn't entirely necessary. Changing that alone didn't fix the issue but the previous value was inaccurate. Action (3) is definitely needed though. It's likely more a function of our targets / VSIX packaging logic than the logic in this work around. But our VSIX logic has existed for a while now mostly unchanged and I imagine when this bug is fixed it would continue to work as was previously defined. |
Expect: all netstandard facades appear in bin directory.
Actual: System.Security.Cryptography.Algorithms.dll is missing. Notice the following (among others) in the log:
Bug is here:
sdk/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.ConflictResolution.targets
Lines 23 to 47 in b20dc82
.NET Core is the only thing that understands RuntimeTarget items. I suspect that whole item should be conditioned on something (TargetFrameworkIdentifier?) that means "I should get RuntimeTarget items copied".
/cc @dsplaisted
The text was updated successfully, but these errors were encountered: