-
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
.NET Framework web projects fail with BadImageFormatException when referencing netstandard1.5 or later library #1509
Comments
Here's the workaround:
@livarcocc if possible we should try and get this in for servicing. |
@dsplaisted / @livarcocc now that #1582 is merged can you ensure it flows to the right places to get updates out in a servicing release? |
@ericstj This will go into VS 15.4, and the .NET Core SDK 2.0.2. |
Also the standalone MSI? |
We need to fix #1539 in the standalone MSI, then we should do a release with both fixes. |
In a solution (vstudio 2017 enterprise or community) with web projects target .net 4.6.1 and .net core 2 when I compile one of them the others get its bin folders corrupted and appears the file netfx.force.conflicts. This is causing me a lot of time lost. Please help with fix that wrong behavior. |
I am still seeing this issue in a solution targeting 4.7. its happening on both web and api projects in this solution. I can delete the bin folder as a workaround but it's very tedious. Also, the RemoveNetFxForceConflicts target XML above doesn't seem to make any difference at this point. please advise. |
@dsplaisted please make sure that to fix this you also update the version of the support package that gets used in the CLI repo. I see that still seems to be the old one: https://github.com/dotnet/cli/blob/release/2.0-vs/build/DependencyVersions.props#L19 |
Fixed it by deleting the netfx.conflict dll in project bin folder |
This is happening when someone tries to debug the web application. Something in the web project system is copying reference-only (Private=false, CopyLocal=false) assemblies to the output directory, and then ASP.NET later tries to load these for execution. See https://github.com/dotnet/corefx/issues/23229.
We should get to the bottom of why this happens, it seems to only do it for assemblies which don't already have an implementation in the output directory. The only case like this is the
netfx.force.conflicts.dll
.Regardless of root cause we probably need a workaround in the SDK since these targets need to work on older versions of Visual Studio (which will never see any fix made to the web project system).
Since
netfx.force.conflicts.dll
is not needed at compile time at all, we can actually remove it from ReferencePath after RAR is done with it. It's sole purpose is to force conflicts for every assembly that is inbox so that bindingRedirects will be generated to the assemblies in the app.The text was updated successfully, but these errors were encountered: