-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
System.Memory 4.6.0 release issue with NET48 #109827
Comments
Tagging subscribers to this area: @dotnet/area-system-memory |
If you are seeing an error for 4.0.1.2, it seems to me that you still have that old DLL lying around in the Also triple check that you don't have the old reference in other dependent projects by upgrading the package in the entire solution to the same version. |
That was part of my attempt to get things working last night. I completely cleaned out my bin folder. Made sure there were no other dlls in the website folder. Removed .vs. Did Update-Package –reinstall for each of the packages. I'd run into something similar about 10 years back where I learned about .vs not always playing nice on VS updates so it's part of my toolset. Sorry I didn't mention in my original post. |
My next suggestion would be to double check all references to |
@julealgon There is no project.assets.json nor obj folder in my ASP.NET 4.8 Web Site project. As a FYI, here's my packages.config so you know what it's using. Things only die when I switch System.Memory to 4.6.0 from 4.5.5. |
I thought you meant you were having problems with a WebForms project, not a Web Site? Can you confirm? Regarding the lack of the folder, I forgot that's probably only generated when using SDK-style csproj which I assume you are not using on this particular project... I'm using this for a while now and forgot some things only apply there. Are you still using If you already use those, then I'm out of suggestions for now and would probably ask for a small repro if you could create that. |
@julealgon ASP.NET 4.8 WebForms(aspx/asmx) as "Web Site" in my solution. There is no .csproj for this type, thus, no ability to switch to PackageReference. This is how it appears in the .sln: Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WinVoice", "WinVoice", "{961A922C-59F6-465C-BC2C-825FDE57A2CC}" |
Oh interesting @NXTwoThou ... I see now. Sorry I don't have any other suggestions (other than potentially suggesting a conversion from WebSite to a WebApplication project, although that might be a larger effort for you). |
@julealgon Thanks for the help. Everything is stable right now with 4.5.5 and everything else up to latest versions. If I get a pausing point in this project that got slammed on my desk at the end of the day yesterday, I'll see what I can do about creating a minimal repo. Meanwhile I'll just watch to see if anyone else has a similar issue and if there's an update to System.Memory I'll test to see if it has the same issue. It's just a NuGet update, edit the web.config bindingRedirect, launch the site, log in, and about 3 clicks in can trigger it. I did it a -lot- last night trying different versions of the other 8 packages that got updated this week. |
|
Same problem here, folks. When I add a binding redirect for System.Memory to 4.0.2.0 it "goes away" but then the same issue arises for System.Buffers Any suggestion what to redirect that to? |
AutoGenerateBindingRedirects generates this entry in the exe.config for my 4.8 Winforms application:
and my .net Winforms 4.8 app works. Btw, those old libs have a new home at https://github.com/dotnet/maintenance-packages and this issue should be transfered to the new location. |
@rozeboosje also add the entry |
Nope, not available. ASP.NET web site in solution explorer. No .csproj, just a path to a folder, which is why it uses packages.config and can't take advantage of autobinding. |
Thanks folks.... BindingGenerator appears to be a lifesaver here |
Assigned to @tannergooding to review this and determine if further triage is needed. |
I encountered the same issue while updating from System.Memory 4.5.5 to 4.6.0. In my case:
I have already ensured that both projects have the correct app.config with binding redirects. Has anyone found a workaround for this scenario? Could this be related to how NUnit/MSTest handles dependencies? |
We're using
Adding System.Memory as a Top-Level dependency using version 4.6.0 doesn't change the exception. I'm kind of at a loss here... Any estimate on a fix for this issue? |
After fiddeling with this for hours on end in the last couple of days and just a bit more of it right after my previous post, I've discovered, that using System.Collections.Immutable (v9.0.0) instead of version 9.0.2 in the .NET Framework associated projects resolves the issue. System.Memory and System.Buffers both can be set to their latest version of 4.6.0 each. No clue, what that's about specifically, but might be worth investigating as well! |
CC. @ericstj, this is an issue that looks related to binding redirects and other package complexities that you're much more knowledgeable around. Is this something that you or someone on your team can assist with? |
The original post mentioned
This error cannot occur if the
If anyone has a repro project they'd like to share we can have a look and help point out what's going wrong. Most likely your project isn't set up to autogenerate bindingRedirects. As @NXTwoThou mentioned -- |
Unit test frameworks need to honor the test assemblies xunit has support https://github.com/xunit/xunit/blob/72878584ab032c9d7cd02a3387de36e1b3233938/src/xunit.v3.runner.utility/AppDomain/AppDomainManager_AppDomain.cs#L167 |
I haven't heard back if folks are still facing issues here. I'll go ahead and close this - if anyone has tried the above and still facing issues either reopen this issue, or open a new issue with a repro attached. Thank you. |
I still have to maintain a bunch of ASP.NET webform projects. The solutions are a mix of .NET 9(winform/console) and .NET 4.8(asp.net webform and winform). Yesterday a lot of NuGet updates became available.
Microsoft.Bcl.AsyncIntefaces 9.0.0
System.Buffers 4.6.0
System.IO.Pipelines 9.0.0
System.Numerics.Vectors 4.6.0
System.Runtime.CompilerServices.Unsafe 6.1.0
System.Text.Encodings.Web 9.0.0
System.Text.Json 9.0.0
System.Threading.Tasks.Extensions 4.6.0
and
System.Memory 4.6.0
All of the .NET 9 apps run perfectly. The ASP.NET webform sites get errors trying to use System.Text.Json functions gives the following error:
FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
If I revert to System.Memory 4.5.5, everything works fine. Reverting System.Text.Json to 8.0.0.5 gives the same error. Reverting everything but System.Memory back to the versions before still gives the same error. The only way to not error out is putting System.Memory back to 4.5.5.
I use BindingGenerator to build my assemblyBinding for my web.config
For System.Memory 4.6.0 it gives
For System.Memory 4.5.5 it gives
I recognize that .NET Framework bindings are kind of held together with duct tape. But this is the first time I've really run into an issue that bindingRedirect hasn't resolved.
The text was updated successfully, but these errors were encountered: