Useful and lightweight tool that has no impact on other devs in the same team. Highly recommend it. Very small glitch that requires a minor hand edit to fix a path.
Because VS2012 & VS2010 now can open the same solutions/projects, could it be better to change the UsingTask from this:
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
to this:
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />
idea took from this thread: http://msdn.microsoft.com/en-us/library/jj860450(v=vs.103).aspx
Thanks.
using v$(VisualStudioVersion) doesn't work when you're building outside of Visual Studio (i.e., msbuild from the command line) you end up with "v" instead of "v10.0" or "v11.0"
thanks for the tip against the msbuild, I will take in mind and actually in the build server maybe I need to push the library "Microsoft.Web.Publishing.Tasks.dll" as a custom dll, I don't know if on the team foundation service for example, there's that dll installed in that folder, i will check...
I have a small issue with the VS 2012 support. When I invoked "Add Config Transforms" the proj file was updated with a build task that references $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll
which is not a valid path, it should be "v11.0". Once I edited that by hand everything worked great. Thanks
I haven't been able to use your extension yet.
I get several initial errors with the message "Command Project.UnloadProject not available" that after change to info messages saying that "No changes were made".
Can you advise?
Update: uninstall / reinstall / new problem
I uninstalled the downloaded extension, restarted VS2010, went to extension manager and intalled it from there, restarted VS2010 again.
Now the problem id "Object reference not set to an instance of an object"!
Hi,
When I tried to do the Add Config Transforms to a web project's Web.config it created the following XML in the project file, so I had to edit it manually. ItemGrop not being valid. Otherwise, wonderful extension!
<ItemGrop>
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGrop>
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="AfterCompile" Condition="Exists('Web.$(Configuration).config')">
<!--Generate transformed app config in the intermediate directory-->
<TransformXml Source="Web.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="Web.$(Configuration).config" />
<!--Force build process to use the transformed configuration file from now on.-->
<ItemGroup>
<AppConfigWithTargetPath Remove="Web.config" />
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
<TargetPath>$(TargetFileName).config</TargetPath>
</AppConfigWithTargetPath>
</ItemGroup>
</Target>
I had the same problem with the misspelled elements. It adds the elements <ItemGrop> (missing the 'u'). This has to be manually changed to <ItemGroup>. Other than that, works perfectly. Now TFS Build transforms the app.config properly. Before, the transform was only working with local builds in Visual Studio.