-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unable to publish project on Linux on 2.1 Preview 2 #2207
Comments
From @RussKeldorph on April 25, 2018 19:18 @danmosemsft @karelz |
From @danmosemsft on April 27, 2018 20:37 @steveharter any idea where this should go? |
Aren't these NuGet errors? |
From @danwalmsley on April 29, 2018 19:39 @karelz dotnet build works on its own. I left the project files as they were .netcoreapp2.0. I will have a go at minimizing the repro. |
From @danwalmsley on April 30, 2018 15:53 @karelz the references are Project references not Nuget packages. Im trying to get you a minimal repro asap. |
From @RussKeldorph on May 1, 2018 17:20 @karelz Do we know enough to say where this bug should be tracked? Do we know if it might require a 2.1 fix? |
From @danwalmsley on May 2, 2018 17:0 Repro.zip Extract the zip file. Install dotnet 2.1 preview 2 cd into AvalonStudio.Languages.Xaml directory. run you will get the error, uninstall the preview and go back to version 2 sdk. run the publish command again, it will work. |
Also id like to state that this is not Linux specific, I can also repro this on Widows too. |
The output on v2.0 sdk:
the output on 2.1 preview 2
|
cc @dsplaisted |
@danwalmsley This was broken by #2085. As a workaround, you should be able to put the following in a PropertyGroup in AvalonStudio.Languages.Xaml.csproj: <TargetLatestRuntimePatch Condition="'$(RuntimeIdentifier)' != ''">true</TargetLatestRuntimePatch> The bug is that if a .NET Core project with an OutputType of Library references one with an OutputType of Exe, you will get a failure if you try to do a self-contained publish. This is because the Exe will roll-forward to the latest patch of .NET Core, but the app won't, leading to NuGet complaining about a package downgrade. Can you help me understand why Avalonia is doing a self-contained publish of a library? That's not the only way you could run into this issue (in general restoring, building, or publishing a project with a RID specified and where there is a library referencing an Exe would hit it), but I don't think doing a self-contained publish on a library is something we designed for, so you might run into other issues. |
Thanks for the explanation, I'm only publishing a library for the repo. My actual use case is that this is normally referenced by an executable project which is how I came across it. Thanks for the workaround 😀 |
@dsplaisted I added the property, but I now get a different error:
|
@danwalmsley I wasn't able to actually build the repro because I had the following restore errors. So I didn't hit the build issue you encountered. Is there a NuGet feed I need to add to be able to restore these packages?
|
just so you know I'm still getting this on RC1. |
If I retarget the projects to all be .netcoreapp2.1 then it will publish, but still need a fix / workaround so I can target 2.1 |
any update? |
@danwalmsley you will need to add <PropertyGroup>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup> to the host app project as well for this error. Or publish using dotnet publish -f netcoreapp2.0 -r win7-x64 -p:TargetLatestRuntimePatch=true |
Thanks finally I managed to get the workaround to work :) |
From @danwalmsley on April 25, 2018 15:57
Hi, my project built and published no problem on 2.0 and 2.1 Preview 1
but now I get:
AvalonStudio.csproj
is anetcoreapp2.0
project.AvalonStudio.Languages.Xaml.csproj
is anetcoreapp2.0
projectAvalonia.Designer.HostApp
is also anetcoreapp2.0
project.The previous version was happy with this.
The repository containing the code at specific commit to repro is here:
VitalElement/AvalonStudio@e947164
git clone --recursive
cd AvalonStudio\AvalonStudio\AvalonStudio
dotnet publish -c Release -f netcoreapp2.0 -r debian.8-x64
Let me know if I can provide any further information.
Thanks in advance.
Copied from original issue: dotnet/coreclr#17774
The text was updated successfully, but these errors were encountered: