-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Bug]: removing the reason of bindingRedirect doesn't trigger exe.config file to be regenerated #9773
Comments
May be caused by or at least related to #8749. |
I repro this issue when build (not rebuild ) the project when remove the reference. And I think it's related with #10644 |
@YuliiaKovalova This issue is since @(SuggestedBindingRedirects)' == '' after remove the assembly reference. The task Here is binlog msbuild.binlog.txt |
Reactivating because I'm about to revert #11012. |
to return the fix we need to exclude the new logic from DTB by adding |
@YuliiaKovalova It works after add |
Issue Description
When I add 2 references to 3rd party libraries, which have a version conflict, a bindingRedirect will be automatically added to the config file of the start-up project on the next msbuild.
But when then I remove one of the references, the config file is not regenerated on the next msbuild and still have a bindingRedirect.
A workaround is to call "msbuild /t:Rebuild" explicitly.
Steps to Reproduce
Create a project of the type "Console application" in .Net Framework 4.7.2.
Add a default App.config file.
Add an assembly reference to ServiceStack.Redis.8.0.0 located locally.
Add an assembly reference to System.Runtime.CompilerServices.Unsafe.6.0.0 located locally.
So the csproj file has the following:
Execute msbuild in the project folder.
Intermediate result (expected): a file projectName.exe.config has the App.config content plus a bindingRedirect for System.Runtime.CompilerServices.Unsafe.
Remove the assembly reference to System.Runtime.CompilerServices.Unsafe.6.0.0.
Execute msbuild in the project folder.
ConsoleApplication472.zip
Expected Behavior
projectName.exe.config file should be regenerated and have no bindingRedirects. It should only contains the content of the original App.config file.
Actual Behavior
projectName.exe.config's content remains unchanged (it was not regenerated from the previous msbuild call). It contains a bindingRedirect.
Analysis
No response
Versions & Configurations
MSBuild version 17.9.5+33de0b227 for .NET Framework
17.9.5.7608
.Net Framework tested: 4.7.2 and 4.8
The text was updated successfully, but these errors were encountered: