Closed SeppPenner closed 3 years ago
Ok, I found the issue, but still I don't understand it. My project file has specified the following:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<LangVersion>latest</LangVersion>
</PropertyGroup>
// And so on ...
If I run dotnet publish --configuration Release -r win10-x64 --output publish/
, the above error occurs. If I run dotnet publish --configuration Release --output publish/
, leaving the runtime out, it works as expected.
Thanks for contacting us. It looks like you didn't complete migration properly. We recommend following our migration guide and asking questions in StackOverflow if you face issues with it.
Thanks for the information, I thought, I did everything in there...
In case anybody gets the same issue, I have:
@using Microsoft.AspNetCore.Components.Web.Virtualization
in the _Imports.razor
file (I don't believe this caused the issue, but still).PreferExactMatches="@true"
in App.razor
(I don't believe this caused the issue, but still).<Project Sdk="Microsoft.NET.Sdk.Web">
instead of <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
on the client side project (One of the things to look at).<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.1" />
which shouled be removed (One of the things to look at).builder.RootComponents.Add<App>("app");
instead of builder.RootComponents.Add<App>("#app");
(Which wasn't an issue for me as I didn't use the client side as standalone, but still).<app></app>
instead of <div id="app"></div>
in the client side index.html
file.So, probably the issue in my case was the wrong SDK and the reference to Microsoft.AspNetCore.Components.WebAssembly.Build
.
Describe the bug
I recently tried to switch my Blazor server side (with a custom Blazor library) project from
netcoreapp3.1
tonet5.0
. However, after changing the framework versions, I now fell over the issues that somehowSystem.Console.dll
seems to be overwritten from the server file (If I understood https://github.com/dotnet/aspnetcore/issues/26928 correctly). Is there anything else I could check to see where exactly the issue is? Right now, I have no idea which packages or projects cause the issue. This only occurs while publishing, e.g. withdotnet publish --configuration Release -r win10-x64 --output publish/
...To Reproduce
Difficult to say, I wasn't able to reproduce this in a minimum working example yet.
Exceptions (if any)
Further technical details