-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[5.0.100-rc.2.20464.10] Single File publish failed for dnspy app after retarget .NET5 #42362
Comments
Tagging subscribers to this area: @agocke |
We throw here because we try to add 2 items in FilesToBundle that gets resolved to the same relative path, Microsoft.DiaSymReader.Native.amd64.dll.
Need to find why rid fallback logic picked both win-x64 and win |
The csproj file for the project, dnSpy.csproj, contains a package reference to Microsoft.DiaSymReader.Native and the reason for the duplicate files being included above for the self-contained SingleFile build failure (the FX assemblies also includes this file). Removing the reference to Microsoft.DiaSymReader.Native in the app proj file or building a FDD SingleFile app will be successful. However, the app will fail given the multiple use of System.Reflection.Assemly.Location in the app code which will return an empty string. Still need to track if SingleFile should take care of scenarios like this but likely on a different issue so as not to confuse. |
Same error is also reported with NugetPackageExplorer. For NPE, we checked the latest source code & built with RC2. Error logs: |
This looks like a problem with the product build -- the GenerateBundle task is verifying that none of the output files have the same name, but that doesn't seem to be the case here. This is a bug in publishing, sometimes called "double write", where binaries with the same name or content are referenced twice by a project. This tends not to be a fatal error for MSBuild as the files are simply copied over one another, but it is an incorrect build graph. This is, however, a fatal error for single-file, as we cannot choose which file is the "right" one to include in the bundle. |
I'm a bit confused, @agocke has this issue been fixed then? Or are we using microsoft/CsWinRT#442 to track this? |
I don't see why there is a bug here, since single-file publish has never worked for dnspy before. There isn't an expectation that single-file publish always works out of the box, so right now I don't think there's any runtime-specific bug to track here. (The R2R bug looks separate, can't speak to that) |
Application Name: dnspy
OS: Windows 10 RS5
CPU: X64
.NET Build Number: 5.0.100-rc.2.20464.10
App Source :
\appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\AppSources\dnSpy
DevDiv issue: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1215382
Repro steps:
Install .NET5.0.100-rc.2.20464.10 SDK on local machine.
Target .NET5
Copy '\appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\AppSources\dnSpy' to local machine.
Open command prompt window and navigate to %localpath%\dnSpy\dnSpy\dnSpy folder.
Run "dotnet publish dnSpy.csproj -r win-x64 -p:PublishSingleFile=true --self-contained true --framework net5.0-windows".
Expected Result:
dnSpy app should be published successful.
Actual Result:
Get error, results the publish process failed.
Findings :
If we publish without "-p:PublishSingleFile=true" flag, the publish process is successful.
After add the "-p:PublishSingleFile=true" flag, the publish is failed.
We attached the failed publish log (WithSingleFileFlag.txt) with "-p:PublishSingleFile=true" and the successful publish log (WithoutSingleFileFlag.txt) without "-p:PublishSingleFile=true" in Attachemenet.
WithSingleFileFlag.txt
WithoutSingleFileFlag.txt
Exception message for failed publish :
cc @dotnet-actwx-bot
The text was updated successfully, but these errors were encountered: