The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly - visual-studio-2012

After installing Slow Cheeath (v. 2.5.10.3) to two projects in my solution, I am receiving the following error:
"The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users
\User\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll. Could
not load file or assembly 'file:///C:\Users\User\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 <UsingTask> 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. ISA.IMPD.FalseAlarm.Web.Portal"
I have removed both projects in their entirety (along with Slow Cheetah), re-installed both projects (along with Slow Cheetah), and Rebuilt the solution to no avail. Can anyone help with this type of error?

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:
You need to close Visual Studio, then navigate to:
C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions
Delete the cache file that has the latest date and time
Open Visual Studio and remove Slow Cheetah from the Solution level
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.

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

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.

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:
Uninstalling the SlowCheetah extension from the TOOLS > Extensions and Updates... menu
Closing Visual Studio
Deleting all files in the "C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions" folder
Opening Visual Studio
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.

Related

References and .dll missing from TFS get latest

I'm having an issue related to team foundation server with Visual Studio 2012.
I've checked in a new solution to the server, however when i get latest version for other machines, most of the references are missing and the .dll files in the bin cannot be located.
Is this because the files are not being pushed when i check in.
Any help is appreciated thanks
In Solution Explorer, right click the DLLs that aren't being included, go to Properties, and be sure that the Build Action is set to "Content".
Check whether you are using MSBuild-Integrated solutions or using Automatic Package Restore. If you use MSBuild-Integrated solutions, migrating MSBuild-Integrated solutions to use Automatic Package Restore.
If you haven't used Nuget to restore package. Check: https://docs.nuget.org/consume/package-restore
Check whether your project link to other projects. Don't reference output assemblies. Make a project reference or create a NuGet package.

Project is targeting frameworks not installed or are included as part of future updates to Visual Studio

I am attempting to convert the Microsoft.Health C# class library that is installed as part of the HealthVault SDK, using instructions provided here. After following these instructions, I get the following error when attempting to load the project into Visual Studio 2013.
"The project is targeting frameworks hat are either not installed or
are included as part of future updates to Visual Studio. See
http://go.microsoft.com/fwlink/?LinkId=287985"
Visiting the link takes me to .NET SDKs and Downloads. Once there, I have no clue on what needs to be done.
I do realize that one will have to leverage the Portable Class Library Contrib project to fill in some missing bits, especially code related to System.Security. This, I will deal with later.
Any one run into a similar problem?
Maybe so late but for those who have the same problem.
I had the same error in a project which was working perfect before updating VS2013 and finally after 3 hours looking for the source of the error I found that the error is about TargetFrameworkProfile.
In my case I sloved it like so:
Right click in the unloaded project in your solution and click Edit.
Find the TargetFrameworkProfile tag and set it as below:
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
At a guess, this is because you need to specify the TargetFrameworkVersion and TargetFrameworkProfile properties in the project file. Compare the .csproj you are trying to create to a newly created PCL project file, and make sure that everything that's not specific to your project matches.
I ran into the same issue and got it resolved by installing the latest Visual Studio Update

Deploying WPF Application with 3rd Party DLLs

I've been extremely frustrated trying to deploy a C#/WPF application I've created that has some references to 3rd party DLLs. I created a folder in the project, called lib, where I placed all of these DLLs. In VS2012, I added the references by browsing to that folder, and selecting all the DLLs. Copy Local is set to true for all. Everything is fine when I build and run, but when I choose publish, and create a OneClick Installer, things aren't so smooth. During the publish wizard, I set it to install from disk, and set it to never check for updates. I take that folder, place it on a flash drive, plug it into another PC, run the setup, and it throws an Exception. I believe I know what is happening, but I cannot figure out how to package this in order to deploy it correctly.
One of my DLLs is a C# wrapper to a DLL that is designed for a C++ project. We'll say, Application requires DLL1 and DLL1 requires DLL2. DLL2 cannot be added as a reference in the project because is not a .NET DLL. DLL1 requires DLL2 to be in the same folder in order to pick it up. I'm using CefSharp which wraps the Chromium Embedded Framework.
I've tried placing the required DLLs for CefSharp.dll in the publish/Application Files directory, but it did not work. I noticed that all of the DLLs that are there from VS2012 have a .deploy extension on them, I even went and added that extension on to see if it was scanning for that to pick up, but it did not work either. This is my first time doing development and deployment for a Windows application and all of the tutorials on MSDN or blog posts I've read do not seem to cover this case, and I do not see any other options in the deployment manager to handle these types of cases.
If it helps, the Exception Code that is thrown is: CLR20r3
When I catch and display Exception, all of the info I am provided basically says CefSharp.dll or one of it's dependencies cannot be loaded. Which I've gotten before when DLL2 was not in the same folder as DLL1.
Can anyone provide help on how to deploy from VS2012 with a situation like this?
Thanks in advance!
Edit: Info Update
I was attempting to push a debug build version to a test machine without Visual Studio installed. When building for CefSharp or any other C++ Runtime DLL, it will look for all of the Debug versions of the DLL which are usually the same name, but with the letter 'd' added to the end. As mentioned below, the Debug version of the C++ Runtime is not redistributable. Not that you can't manually add those DLLs to your project and set them as Copy Always, but that's kind of a hack job. I started a new project from scratch, added all Release versions of the DLLs, built, and everything was fine.
I've been tearing my hair out trying to fix this very problem this morning and eventually found the solution. It seems you already know which DLLs etc. you need for CefSharp to work but I thought I would run through this in case anyone else is having the same problem. I have a C# WPF application and I'm using CefSharp as the web view. I'm using CefSharp v1 because I need the JavaScript -> C# bridge they provide which isn't yet implemented in v3. Here are the rough steps I went through in setting up the project (I'm using VS2013 but this will probably work in VS2012).
Installing CefSharp
Install CefSharp.Wpf through NuGet (I'm using v1.25.7)
That should put the relevant files in $(SolutionDir)packages\CefSharp.Wpf.1.25.7\cef
Configuring Build
To get the CefSharp DLLs to copy to our build folders, right-click on your project, select Properties -> Build Events and enter the following in the "Post-build event command line":
xcopy "$(SolutionDir)packages\CefSharp.Wpf.1.25.7\cef*" "$(TargetDir)" /s /y /i
That should now copy all of the required DLLs from the cef folder as well as the devtools_resources.pak file and the locales folder plus its contents. I require them in my project as I need the chromium dev tools.
Double-check your project references contain CefSharp and CefSharp.Wpf. That should have been taken care of by NuGet.
Taking care of Visual C++ 2012 Runtime Files
I didn't want the user to have to download the whole Visual C++ 2012 Runtime Files as part of the deployment so through Visual Studio, add the folder Lib\Microsoft.VC110.CRT and add the 3 DLLs (msvcp110.dll, msvcr110.dll, vccorlib110.dll) from the following folder on your machine to the folder you just created in your project:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\redist\x86\Microsoft.VC110.CRT
Select the 3 DLL files in Visual Studio, right-click -> properties. Make sure Build Action is set to "None" and Copy to Output Directory is set to "Do not copy". Now you need to add another post-build event to make sure these are copied properly (i.e. copied to the root so they sit alongside the CEF dlls and your project exe) for debug.
Right-click on your project, select Properties -> Build Events and enter the following in the "Post-build event command line" just after your other xcopy command for CEF:
xcopy "$(ProjectDir)Lib\Microsoft.VC110.CRT*.*" "$(TargetDir)" /s /y /i
At this point, everything should be building. To publish the app with ClickOnce, I need it to push all of the CEF DLLs out as well as ensuring the files/folders required for chromium dev tools are present. If you don't need the dev tools or all of the DLLs then you can tweak this accordingly.
Ensuring CEF and C++ runtime files are deployed with ClickOnce
Right click your project in Visual Studio and select "unload project".
Right click and select to edit the csproj file.
Before the closing </Project> tag add this
<ItemGroup>
<Content Include="$(SolutionDir)packages\CefSharp.Wpf.1.25.7\cef\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(ProjectDir)Lib\Microsoft.VC110.CRT\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
That will add everything from the cef folder into the project and make sure the C++ binaries are copied to the root of the project on deployment. In my case for CEF, I'm using the \**\* syntax at the end of the Include and %(RecursiveDir) to ensure all of the files are copied as well as the locales folder with its contents and structure preserved. Having set <Visible>false</Visible> you won't see the items in the solution explorer.
Relax
Now if you publish your app, it should copy over all of the required files and folders.
You could try this which solved a similar issue for me:
Add the DLL's that are not .NET libraries to the solution as files:
Right click project > Add > Existing Item
Then set their build action to Content and "Copy to output directory" to "Copy Always".
That way the libraries will be included in the output directory.
Since you already tried manually adding the suspect dll and it still does not work, the next thing I would do is run fusion and see what it really is complaining about, in other words what exactly is the dependency that can not be loaded. Here is a good tutorial on how to hunt down these types of errors:
Back to Basics: Using Fusion Log Viewer to Debug Obscure Loader Errors
Maybe you can work it out from the https://github.com/Code52/DownmarkerWPF sources?
They have at least a working ClickOnce installer for their app embedding CefSharp. I know because that's the way it got installed on my machine!
update just saw in comments that it's the VC Redist that you say you are missing then Distributing the Visual C++ Runtime Libraries (MSVCRT) seems relevant.
Also I seem to remember something vaguely about that for "VCRedist reasons" you are not supposed to distribute debug versions of your application. Can't you just switch from a Debug to a Release version? With this I think you can either bundle the needed VCRedist files as suggested in the CefSharp FAQ or add VCRedist as a prerequisite in your installer. DownmarkerWPF does it with their WIX installer setup which you can find on a branch in their GitHub repo. Something similar is AFAIK possible with the VStudio bundled installer if that's what you use.
Thanks to Barrie's answer to this, it helped me greatly. I'm using his answer below, but updating it to work for the latest CEF using Visual Studio 2015.
NOTE: I am only building/targeting the x86 platform. You may need to change or include x64 in the copy commands below to suit your needs.
Installing CefSharp
Install CefSharp.Wpf through NuGet (I'm using v51.0.0)
NuGet Library After Install
That should put the relevant files in
$(SolutionDir)packages\CefSharp.Wpf.51.0.0\CefSharp (CefSharp.Wpf)
$(SolutionDir)packages\CefSharp.Common.51.0.0\CefSharp (CefSharp.Common)
$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF (Cef x86 redist)
$(SolutionDir)packages\cef.redist.x64.3.2704.1432\CEF (Cef x64 redist)
Configuring Build
To get the CefSharp DLLs to copy to our build folders... I don't believe this is necessary anymore with the later versions of CefSharp. I found that I didn't need any of the "Post-build event command-line" xcopy stuff to get Click-Once to ship it out. (And yes, DevTools works too!)
Taking care of Visual C++ 2012 Runtime Files
(Switched to VCR 2013) I didn't want the user to have to download the whole Visual C++ 2013 Runtime Files as part of the deployment, so through Visual Studio, add the folder lib\Microsoft.VC120.CRT and add the 3 DLLs (msvcp110.dll, msvcr110.dll, vccorlib110.dll) from the following folder on your machine to the folder you just created in your project:
C:\Windows\SysWOW64
(Didn't see them in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist)
At this point, everything should be building. To publish the app with ClickOnce, we need it to push all of the CEF DLLs. You can tweak this accordingly...
Ensuring CEF and C++ runtime files are deployed with ClickOnce
Right click your project in Visual Studio and select "unload project".
Right click and select to edit the csproj file.
Before the closing tag add the following:
<!-- BEGIN: CUSTOM ITEM GROUP INCLUDES INTO THE PROJECT (SO CLICK-ONCE PUBLISHES THEM) -->
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\*" Exclude="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\x86\**\*;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\locales\**\*.pak">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\en-GB.*;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\en-US.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\x86\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\CefSharp.Common.51.0.0\CefSharp\x86\**\CefSharp.BrowserSubprocess.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(ProjectDir)lib\Microsoft.VC120.CRT\**\*">
<Link>%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<!-- END: CUSTOM ITEM GROUP INCLUDES INTO THE PROJECT (SO CLICK-ONCE PUBLISHES THEM) -->
That will add everything from the cef folder into the project and make sure the C++ binaries are copied to the root of the project on deployment. Having set false you won't see the items in the solution explorer.
REMEMBER: I am only building/targeting the x86 platform. You may need to change or include x64 in the copy commands below to suit your needs.
Publish
Now if you publish your app, it should copy over all of the required files and folders.
(EXTRA INFO) Supporting Older Operating Systems Info Below
If you need to use CefSharp for older machines (XP & Vista), simply
install CefSharp.Wpf through NuGet using the older v47.0.0 version and change your .NET targeting to .NET 4.0 Client Profile.
Chromium ended support for XP and Vista in April 2016, CefSharp version 47 (or there abouts) still had support for it.
Another note on a problem and fix for XP:
There is a Chromium issue for XP deployments. Below is the article describing the fix followed by steps to deploy fix for JBCB.
Here's the link to the article:
https://bitbucket.org/chromiumembedded/cef/issues/1787
...in it you'll see a reference to download a "dbghelp.dll". Download and extract.
YOU CAN TAKE A POST-INSTALL APPROACH LIKE BELOW OR CHOOSE TO INCLUDE THE DLL ALONG WITH YOUR OTHER PUBLISHED FILES. I'M CHOOSING NOT TO DEPLOY THE EXTRA DLL AND ONLY DEPLOY ON XP MACHINES (WE ONLY HAVE FEW) MANUALLY.
Take these steps to fix deployment on an XP machine:
Install the CefSharp Browser on the XP machine (via Click-Once)
Copy the "dbghelp.dll"
Paste it in the local install directory on the XP machine (per the instructions in previous link: along side the "libcef.dll" file).
NOTE: For click-once installs, will be in a sub-folder under this location:
C:\Documents and Settings\<UserName>\Local Settings\Apps\2.0\<auto-gen ostificated ID>
Read very carefully the official list of CefSharp dependencies - there are a lot of them! You need to get them all into the ClickOnce bin folder somehow.
Here is how I solved it:
Before deploying, install the latest version of Visual C++ Redistributable. on each PC you are deploying to (using group policy or just manually).
Start with a blank test project.
Add project references to CefSharp, CefSharp.Core, etc.
Add each dependency into a single folder in the project directory to keep them organised (Files\CefSharp\).
Ensure all files are configured with Build Action: Content, and Copy to Output Dir: Copy always.
Make a function Initalise_CefSharpFiles() to copy the files/folders into the bin root folder (where CefSharp looks for them). For example, copy from: Bin\Files\CefSharp\* to: Bin\*.
And finally at run time, call Initalise_CefSharpFiles() once after the app loads, and before initialising CefSharp's settings.

NuGet Package restore failed for project Miscellaneous Files: Value cannot be null or an empty string. Parameter name: root. 0 0

I have such error in vs 2012:
NuGet Package restore failed for project Miscellaneous Files: Value cannot be null or an empty string. Parameter name: root. 0 0
I see that it's a bug https://nuget.codeplex.com/workitem/3780 that was fixed for version 2.8
But I can't find the 2.8 version on https://nuget.codeplex.com
Is it possible to fix the error without the installation of the 2.8 version? Or how to get the 2.8?
I fixed this by deleting the visual studio solution user options file (.suo) and then restarting VS.
UPDATE: For VS 2017, you need to delete a hidden folder named .vs located in solution directory (Thanks #Tien Dinh!)
Had the same issue with VS2013 today.
After running an update on installed packages (tools -> extensions and updates) (which included nuget),
and installing some updates for VS2013 (windows update had some), it has gone away.
So basically, check for those updates, update, and it might solve the issue.
I have VS 2013. According to the extensions manager, nuget was up to date.
Ran a manual install from the vsix site:
http://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca
... fixed the issue.
A simple restart of Visual Studio should clear everything up. I had the same issue in VS2013 after upgrading Web API. It was not necessary to delete the .suo.
I right clicked the solution and chose "Enable Nuget Package Restore". This fixed the problem.
This link from MSDN shows how:
http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx
nuget visual-studio
I fixed this by enabling auto restore on nuget packages in the solution
Not an exact answer, but best I can tell, NuGet ver. 2.8 is not available yet. I have been dealing with the same issue for sometime now (2 months). I was still able to build my solution successfully even with that error by performing the build against the main project. I am really hoping to get this issue resolved because it is a serious eyesore while working.
You can get a non-release version of NuGet 2.8 here. Instructions are here: Installing a CI build. This fix the issue for me on VS2010.
I fixed this issue after clicking the "Clear All Nuget Cache(s)"
Just as a brief note. I got this error by running the project on a mapped network drive i.e. T:\NetworkFolder\Project\Solution.sln.
Obviously the solution is simple - don't do this - copy it onto your machine. Might save someone some pain at some point.
None of the above answers helped for me, and it was getting pretty frustrating.
What worked for me (with Visual Studio Professional 2017, version 15.8.5) was doing the following steps;
1) Tools > Options > NuGet Package Manager > Click 'Clear All NuGet Cache(s)'
Hope this helps someone!
It did not work for me. I had to go to tools, extension manager... Uninstall NuGet
Restart Visual Studio 2010
Download NuGet
Reinstall it.
Restart Visual Studio. Fixed it all!
Let's check the name of packages in file packages.config. Sometime the name incorrect it occurr
I got this error by accidentally renaming one of the namespace id attributes inside packages.config file to something else. I was able to track this down by comparing checked in version of packages.config, with my local one. After I corrected the problem, all I had to do is close the packages.config file, rebuild, and the problem was gone.
In Visual Studio 2015:
Go to Options->NuGet Package Manager-> Package Sources, make sure "Microsoft and .Net" is checked in the Machine-wide package list.
I uninstalled and reinstalled nUnit 3.7.1 and everything started working again. I have a few nuget packages, but nunit 3.7.1 is the only one I reinstalled, I left the rest alone.

Where's per-project TargetPlatformVersion?

I have a Visual Studio 2012 solution with a Windows Phone 8 C# project and a Windows Phone 8 C++ library. I've moved it to a different computer. Now, when I try to open the solution, the library project fails to load with the following message in the console:
MyLib.vcxproj : error : Unable to read the project file "MyLib.vcxproj".
MyLib.vcxproj(620,3): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v7.0\Microsoft.Cpp.WindowsPhone.7.0.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
When I look into the project file, I find the following on line 620:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
So it looks like the value of environment variable TargetPlatformVersion is somehow off.
Then I've created another solution on this machine, also C#/C++ combo. That one opens and compiles and runs, nae problemo. Looking at the project file in the newly created library, it has an identical <Import> line near the end.
Now, the solution copying might have been not perfect. I did not copy all files - just what I thought were the relevant ones - the .sln, the .vcxproj., but not the .sdf and not the .suo.
It looks like something was missing - a file that defined the value of TargetPlatformVersion on solution or project level was not copied, and now Visual Studio is picking a wrong default. Needless to say, WP7.0 has nothing to do with it, it's all WP8.
Any idea where could this setting reside? There's no mention of TargetPlatformVersion in neither project nor solution.
It went away on its own after a few reopens and other meaningless actions. Ooky, spooky stuff. No idea why. SVN does not detect any changes to project files.
I had this problem too, and the solution was to install the latest SDK for Windows Phone (SDK V8.0 at this time) in the computer (apparently it had a previous version version or not at all installed).
Step1: Replace every occurrence of $(MSBuildExtensionsPath) to 8.0 in your .vcxproj file
Step2: Restart Visual Studio
->Then You will get the error "The builds tools for v120 (Platform Toolset = 'v120') cannot be found"
To fix this:
if you are using visual 2012 right click on project name -> properties -> configuration properties -> general -> platform toolset -> Visual Studio 2012 (v110) or wp-v110
And You will be good to go!
Note: You can then revert the changes from 8.0 to $(MSBuildExtensionsPath) in your project file if you want. (The cause of the error is when you open a vs2012 project or its dependencies in vs2013)

Resources