|
2 | 2 | ==================================================================================================== |
3 | 3 |
|
4 | 4 | GenerateBindingRedirects Behaviors |
5 | | - |
| 5 | +
|
6 | 6 | Traditionally (Microsoft.Common.CurrentVersion.targets) only Performs BindingRedirect calculations when |
7 | 7 | Project type is deemed to "need" redirects -> when OutputType == 'exe' or OutputType == 'winexe' (Microsoft.Common.CurrentVersion.targets) |
8 | 8 | AND |
|
12 | 12 | A newer Full Framework project TargetFrameworkIdentifier == '.NETFramework' and '$(TargetFrameworkVersion.TrimStart(vV))' >= '4.7.2' (Microsoft.Common.CurrentVersion.targets) |
13 | 13 | Additionally it chooses the filename of the config file to be updated as what exe projects want... |
14 | 14 | $(IntermediateOutputPath)$(TargetFileName).config -> the config file named after the assembly and in the IntermediateOutputPath |
15 | | - |
| 15 | +
|
16 | 16 | https://github.com/CZEMacLeod/MSBuild.SDK.SystemWeb/issues/34 |
17 | 17 | This SDK Project Type will override these settings so that we can facilitate developers working with BindingRedirects in the web.config |
18 | 18 | Enable the Build Process to calculate Binding Redirects |
|
22 | 22 | OverwriteAppConfigWithBindingRedirects -> this is the SystemWeb Sdk Legacy property |
23 | 23 | GeneratedBindingRedirectsAction (Overwrite) -> this will conditionally change wich config file is written to |
24 | 24 | ==================================================================================================== |
25 | | - --> |
| 25 | +--> |
26 | 26 |
|
27 | 27 | <Project> |
28 | 28 |
|
|
31 | 31 | <AutoGenerateBindingRedirects Condition=" '$(AutoGenerateBindingRedirects)' == '' ">true</AutoGenerateBindingRedirects> |
32 | 32 | </PropertyGroup> |
33 | 33 |
|
34 | | - <PropertyGroup Label="Set the desire default behavior of what to do with SuggestedBindingRedirects if not yet set" |
| 34 | + <PropertyGroup Label="Set the desired default behavior of what to do with SuggestedBindingRedirects if not yet set" |
35 | 35 | Condition=" '$(GeneratedBindingRedirectsAction)' == ''"> |
36 | 36 | <GeneratedBindingRedirectsAction>None</GeneratedBindingRedirectsAction> |
37 | 37 | <GeneratedBindingRedirectsAction Condition=" '$(OverwriteAppConfigWithBindingRedirects)' != 'true' ">Preview</GeneratedBindingRedirectsAction> |
|
56 | 56 | |
57 | 57 | In general we want to emit a "warning" whenever we either do, or don't do something to help developers find the property that drives this behavior |
58 | 58 | ==================================================================================================== |
59 | | - --> |
60 | | - <Target Name="SystemWebProject_ChooseConfigFileForGenerateBindingRedirects" |
| 59 | +--> |
| 60 | + <Target Name="SystemWebProject_ChooseConfigFileForGenerateBindingRedirects" |
61 | 61 | BeforeTargets="GenerateBindingRedirects" |
62 | 62 | Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true' and @(SuggestedBindingRedirects->Count()) > 0 "> |
63 | 63 |
|
|
67 | 67 | </PropertyGroup> |
68 | 68 |
|
69 | 69 | <Warning Condition="'$(GeneratedBindingRedirectsAction)' != 'Preview' and '$(GeneratedBindingRedirectsAction)' != 'Overwrite'" |
70 | | - Text="Generated Binding Redirects have been applied only to the $(TargetFileName).config. You should incorporate them into the web.config. Consider setting <GeneratedBindingRedirectsAction>Preview</GeneratedBindingRedirectsAction> to create a file containing the proposals. Consider setting <GeneratedBindingRedirectsAction>Overwrite</GeneratedBindingRedirectsAction> to automatically update web.config with proposals." /> |
| 70 | + File="$(TargetFileName).config" |
| 71 | + Text="Generated Binding Redirects have been applied only to the $(TargetFileName).config. You should incorporate them into the web.config. Consider setting <GeneratedBindingRedirectsAction>Preview</GeneratedBindingRedirectsAction> to create a file containing the proposals. Consider setting <GeneratedBindingRedirectsAction>Overwrite</GeneratedBindingRedirectsAction> to automatically update web.config with proposals." /> |
71 | 72 |
|
72 | 73 | <Warning Condition="'$(GeneratedBindingRedirectsAction)' == 'Preview'" |
73 | | - Text="Generated Binding Redirects have been applied only to the Web.BindingRedirects.config. You should incorporate them into the web.config. Consider setting <GeneratedBindingRedirectsAction>Overwrite</GeneratedBindingRedirectsAction> to automatically update web.config with proposals." /> |
| 74 | + File="Web.BindingRedirects.config" |
| 75 | + Text="Generated Binding Redirects have been applied only to the Web.BindingRedirects.config. You should incorporate them into the web.config. Consider setting <GeneratedBindingRedirectsAction>Overwrite</GeneratedBindingRedirectsAction> to automatically update web.config with proposals." /> |
74 | 76 |
|
75 | 77 | <Warning Condition="'$(GeneratedBindingRedirectsAction)' == 'Overwrite'" |
76 | | - Text="Generated Binding Redirects have been applied automatically to the web.config. This warning will disappear on the next build." /> |
| 78 | + File="Web.config" |
| 79 | + Text="Generated Binding Redirects have been applied automatically to the Web.config. This warning will disappear on the next build." /> |
77 | 80 |
|
78 | 81 | </Target> |
79 | | - |
80 | | - |
81 | | - |
82 | 82 | </Project> |
0 commit comments