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
Update to SDK 2.2.100 throws "An item with the same key has already been added. Key: .wasm" #5666
Comments
dotnet --info:
With the Blazor server project example I didn't have any problems on windows - project compiles and runs fine. However when I try to run it in linux (same dotnet version) I have too that exception. Currently updating to:
to check what's up.
After the 2.2.100 update will post comments if something changes. |
@bunakbg I already commented out the whole |
@michaelvolz are you getting this error on windows or linux? because after update to 2.2.100 I don't have this error on windows (still have it on linux tho...)
|
@bunakbg My problems are on windows. This works:
But when I update <TargetFramework>netcoreapp2.2</TargetFramework> and <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2" /> it throws the exception. Additionally I added a {
"sdk": {
"version": "2.2.100"
}
} |
A very, very bad workaround (if you only want to play and test with it, till this is fixed) is to build normal blazor project and manually copy contents of bin/Debug/netstandard2.0/*.* and host them to separate web server. This doesn't fix your problem and it may be reeeally off-topic but it may help you (don't know your case). |
My workaround is simpler. Just use this {
"sdk": {
"version": "2.2.100-preview3-009430"
}
} And you need of course the corresponding SDK installed 😸 |
@michaelvolz interesting stuff ... based on this global.json is no more and it's replaced by *.csproj |
It looks like
was recently added to The UseBlazor method calls CreateContentTypeProvider which will always fail as a result of the .wasm addition:
Update: The issue has been addressed as part of this commit: 5c1fbe1#diff-0cff27aae9e3ba66997ab8244a54fa57 |
I got the exactly same issue this morning. |
@danroth27 is there any chance to get a hotfix for this? |
Any chance someone will make new build with the fixes that @SteveSandersonMS made? I really want a package. 5c1fbe1#diff-0cff27aae9e3ba66997ab8244a54fa57 |
Thanks everyone for reporting this issue! I apologize for the inconvenience. To workaround this issue you will need to have your Blazor projects continue to target .NET Core 2.1 (netcoreapp2.1). We aren't planning to patch this issue because there is a workaround and we are currently focused on getting Razor Components into .NET Core 3.0. This issue will be fixed once we release the first public preview of Razor Components early next year. |
@danroth27 So to summarize, there is currently no support for Blazor on .NET Core 2.2? |
@jcornell I don't think that resolves the issue. The change to use AddMapping() to conditionally add definitions is all fine and good. But the problem is that the BlazorApplicationBuilderExtensions.CreateContentTypeProvider() method adds its own definition for ".wasm" AFTER the FileExtensionContentTypeProvider constructor adds a definition. The same AddMapping() logic needs to be used in CreateContentTypeProvider() or, if ".wasm" is going to be a standard entry from FileExtensionContentTypeProvider, the code can be removed from CreateContentTypeProvider. |
@msauper In the commit that I linked to: 5c1fbe1#diff-0cff27aae9e3ba66997ab8244a54fa57 the Additions are using the same AddMapping() logic:
Or am I misunderstanding what you're saying? |
@isaac2004 That's correct. And instead of spending time patching it we are focusing our efforts on getting Razor Components working in .NET Core 3.0. |
On my linux machines this pinning down works. On my mac however I get the same wasm error as before. Using a
And using 2.1.5 LTS which comes with 2.1.403 SDK On both mac and linux, NOTE: Mac also has 2.2 on it, while some of my linux machines don't |
@SteveSandersonMS, if this is already fixed, please resolve. |
Fixing in #6731 |
Actually it turns out it was already fixed (by conditionally adding the mapping), but the updated fix in #6731 is better because it's simpler. |
I have the issue on
( I included warning just to show the version ) |
@ctrl-alt-d Looks like your app must still be using the earlier packages (Blazor 0.7.0?). It's only fixed in the newer bits we haven't released yet. |
@danroth27 after installing |
@sheryever Could you please open a new issue with the full details on how to reproduce the problem you are seeing? |
@danroth27 our issue resolved, the dictionary was a static variable, we fixed it by using lock statement. The interesting thing that we noticed with aspnet core is, the controller action was not async and neither running any thread but still it looks that more than one thread was accessing the dictionary at once on multiple calls from browser :) |
I updated my Blazor project from
2.2.100-preview3-009430
to2.2.100
release. I now get the following exception:The line
app.UseServerSideBlazor<Client.Startup>();
seems to be the reason.
Any suggestions?
The text was updated successfully, but these errors were encountered: