The “SlowCheetah.Xdt.TransformXml” task could not be loaded from the assembly

十年热恋 提交于 2019-11-29 22:49:06
SashaArz

In my case the error occured while compiling a web project. The folder

%userprofile%\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2

was empty. All the SlowCheetah components were in SlowCheetah\v1 folder instead. I've copied all files from V1 folder to v2.5.10.2 and everything compiled and transformed fine. To make non web projects compile, I also had to delete V1 folder as suggested by Whoever in this thread.

This was a brand new installation of the SlowCheetah Extension and I did not expect the v1 folder to exist at all. I believe this was a bug in the extension installation for Visual Studio 2012.

delete

  AppData\Local\Microsoft\MSBuild\SlowCheetah\v1 

I seem to have found to solution to this problem.

Here's what I did:

  1. You need to close Visual Studio, then navigate to:

  2. C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions

  3. Delete the cache file that has the latest date and time

  4. Open Visual Studio and remove Slow Cheetah from the Solution level

  5. Re-install Slow Cheetah from the solution level to the desired projects.

This was failing on our build server, so I changed the revision number from:

<sc-MSBuildLibPathLocal Condition=" '$(sc-MSBuildLibPathLocal)'=='' ">$(LocalAppData)\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\</sc-MSBuildLibPathLocal>

To:

<sc-MSBuildLibPathLocal Condition=" '$(sc-MSBuildLibPathLocal)'=='' ">$(LocalAppData)\Microsoft\MSBuild\SlowCheetah\v2.5.10.3\</sc-MSBuildLibPathLocal>

Why it was pointed to v2.5.10.2 is a mystery, but I'm definitely using v2.5.10.3! Looks like the nuget package itself has the bug in it.

This problem went away for me after using the preview transformation feature in the context menu. Originally suggested here.

FYI this was on VS 2010 Premium.

I resolved it like this:

  1. Uninstall slowcheetah => Tools>Extensions and Updates
  2. click OK when VS asks you to restart VS.
  3. in "C:\Users\AppData\Local\Microsoft\MSBuild\SlowCheetah" remove the 'v1' folder (which windows automatically creates when restarting your VS) (here be dragons..)
  4. reïnstall slowcheetah (see step 1) => a new folder v2.5.10.2 will be created.
  5. Again, click OK when he asks to restart
  6. Build your solution

Regards,

Peter

Dlk

Having multiple versions can lead to conflicts.

In my case I have installed both Microsoft.VisualStudio.SlowCheetah by Microsoft and SlowCheetah by Sayed Ibrahim Hashimi. After uninstalling the package from Microsoft everything went well.

I have deleted the old files in C:\Users\\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1. I also needed to upgrade Visual Studio 2012 to update 4 to make it work.

I was able to fix this issue by doing the following:

  1. Uninstalling the SlowCheetah extension from the TOOLS > Extensions and Updates... menu
  2. Closing Visual Studio
  3. Deleting all files in the "C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions" folder
  4. Opening Visual Studio
  5. Reinstalling SlowCheetah from the TOOLS > Extensions and Updates... menu (which requires a Visual Studio restart)

This is using Visual Studio 2012 Premium with Update 4 and SlowCheetah version 2.5.10.

If you're getting this error on a TFS Build Server (in my case TFS Express 2013) then you will need to copy over the files from your local machine

C:\Users\SWEAVER\AppData\local\Microsoft\MSBuild\SlowCheetah

on your machine to whichever user your TFS build is running under

C:\users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah

Please note AppData is a hidden directory that you may not see, but just type the name and hit enter and it will come up.

I'm using VS2013 so I didn't copy v1 (I think v1 is for VS2012).


The original TFS error I got was :

C:\Builds\1\www.XXXXX.com\RRStore - XXXXX Silverlight\Sources\RRStore.AdminConsole\Properties\SlowCheetah\SlowCheetah.Transforms.targets (150): The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll' 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.

Fortunately this error told me exactly where to place the files.

I had the same problem in Visual Studio 2013. Just install SlowCheetah NuGet package:

https://www.nuget.org/packages/SlowCheetah

They've released a new version which brings the installation procedure up to date:

https://blogs.msdn.microsoft.com/visualstudio/2017/05/25/whats-new-and-improved-with-the-slowcheetah-extension/

Tired of having to install your NuGet packages manually to get SlowCheetah to work? We’ve added automatic NuGet installation to help streamline your process. All you need to install is the latest extension and SlowCheetah will take care of the rest. When you use SlowCheetah for the first time in a project, it will prompt you to install or update NuGet packages. Agree and you’re ready to go!

  • Close Visual Studio
  • Install the VISX extension
  • Open your project.
  • This version detects if you already have it installed and offers to upgrade.

I would recommend checking in to source control and then doing a compare of your .csproj file to see what changes it made.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!