-
Notifications
You must be signed in to change notification settings - Fork 20
Make it compatible with VS 2017 new .csproj format #7
Comments
To reiterate/confirm the issue, I also installed v3.2 on VS2017 and when "Add Config Transforms" is run the project fails to load with the error:
Here are the elements added to csproj files after "Add Config Transforms" <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
<Target Name="app_config_AfterCompile" AfterTargets="AfterCompile" Condition="Exists('app.$(Configuration).config')" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--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>
<!--Override After Publish to support ClickOnce AfterPublish. Target replaces the untransformed config file copied to the deployment directory with the transformed one.-->
<Target Name="app_config_AfterPublish" AfterTargets="AfterPublish" Condition="Exists('app.$(Configuration).config')" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeployedConfig>$(_DeploymentApplicationDir)$(TargetName)$(TargetExt).config$(_DeploymentFileMappingExtension)</DeployedConfig>
</PropertyGroup>
<!--Publish copies the untransformed App.config to deployment directory so overwrite it-->
<Copy Condition="Exists('$(DeployedConfig)')" SourceFiles="$(IntermediateOutputPath)$(TargetFileName).config" DestinationFiles="$(DeployedConfig)" />
</Target> Once I remove all xmlns attributes in the UsingTask and Target elements, the project can load. Configs are successfully transformed on Build, too. Seems like specifying xmlns is not necessary here? |
+1 have same issue. |
@CometstarMH Removing all |
Thanks this worked |
Creating new issue for the following Closed issue as I don't have permission to reopen and I don't believe issue was resolved.
Issue Url
I've uploaded sample project demonstrating error to original issue.
This is very confusing as the sample project I've uploaded is simply the default"out-of-the-box"
VS 2017 project template and ConfigurationTransform does not work.
The text was updated successfully, but these errors were encountered: