Only VS2017 installed system, having windows 10 : The "TransformXml" task could not be loaded from the asembly

Question

Monday, October 2, 2017 10:10 PM

We upgraded our system to Windows 10 with visual studio 2017. I am getting this error by building our project. I am not sure where this TransformXml is used. I scanned all over the solution to find this occurence. We are using slowcheetah for web.config transformations. I guess that is working good and nothing to deal with this error

Error: The "TransformXml" task could not be loaded from the asembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll. Could not load file or assembly or one of its dependencies. The system cannot find the file specified.Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

solution: I found that v10.0 folder missing in that path.So I created the folder and copied the web folder here; from C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0  It solved the issue. But there should be proper way to solve the issue. Please advise.

All replies (4)

Tuesday, October 3, 2017 2:14 AM ✅Answered | 2 votes

Hi RKDivya,

Welcome to MSDN forum.

Thank you for sharing the solution here which will be helpful for those who has the similar issue with you. Besides, you can edit it in vcsproj file(right click on project->unload it->edit .vcsproj file) :

  1. Open the project file (.vcsproj) of the project failing to load
  2. Search for <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
  3. Change it to <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
  4. Reload the project

Best regards,

Joyce

Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Monday, October 2, 2017 10:08 PM

We upgraded our system to Windows 10 with visual studio 2017. I am getting this error by building our project. I am not sure where this TransformXml is used. I scanned all over the solution to find this occurence. We are using slowcheetah for web.config transformations. I guess that is working good and nothing to deal with this error

Error: The "TransformXml" task could not be loaded from the asembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll. Could not load file or assembly or one of its dependencies. The system cannot find the file specified.Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

solution: I found that v10.0 folder missing in that path.So I created the folder and copied the web folder here; from C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0  It solved the issue. But there should be proper way to solve the issue. Please advise.


Tuesday, October 3, 2017 6:58 AM

Hi RKDivya,

Thanks for posting here.

Since you got this error in Visual Studio, your project may created by previous version Visual Studio, then updated to Visual Studio.

To resolve this issue, you should unload the project in question and then edit the csproj file, look for an entry where they are referencing the 10.0 path and change it to point to 15.0 or using v$(VisualStudioVersion) instead.

For example,

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" />
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />

Change them to:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.targets" />
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll" />

Hope this helps.

MSDN Community Support Please remember to click Mark as Answer. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Wednesday, October 4, 2017 6:01 PM

Thanks Joyce. That worked charm!