Rya*_*yan 5 msbuild configuration web-config transformation
我在我的项目文件中使用以下内容:
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="AfterCompile" Condition="Exists('App.$(Configuration).config')">
<!--Generate transformed app config in the intermediate directory-->
<TransformXml Source="App.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="App.$(Configuration).config" />
<!--Force build process to use the transformed configuration file from now on.-->
<ItemGroup>
<AppConfigWithTargetPath Remove="App.config" />
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
<TargetPath>$(TargetFileName).config</TargetPath>
</AppConfigWithTargetPath>
</ItemGroup>
</Target>
Run Code Online (Sandbox Code Playgroud)
但是,如果我在多行上有一个配置项
<add key="MultiLine" value="option1,
option2,
option3 />
Run Code Online (Sandbox Code Playgroud)
它变成了
<add key="MultiLine" value="
 option1,
 option2,
 option3/>
Run Code Online (Sandbox Code Playgroud)
我怎么能防止这种情况?
谢谢
瑞安
| 归档时间: |
|
| 查看次数: |
358 次 |
| 最近记录: |