Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Cannot build SP 2013 solution with MSBuild when only VS 2013 is installed

$
0
0

Hi!

I have a new development machine that has VS2013 and SP2013 installed. No earlier version of VS apart from the components installed by SQL Server 2012, that also exists on the same machine.

I create a new empty SP 2013 project in VS 2013. I add one feature.

I build and package the solution. All good.

Then I try to build the solution using an msbuild script:

<MSBuild Projects="...somepath...\MySolution.sln"
             Targets="Build" ToolsVersion="4.0" Properties="Configuration=Release;TargetFrameworkVersion=v4.5" />

I run this script by putting it in a .proj file that I execute with the following command:

"%windir%\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe" Build.proj /toolsversion:4.0

I get the following: error MSB4019: The imported
 project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Which is true. This file does not exist in the path but only in VisualStuiod\v12.0 since that is the one for VS 2013.But why is it looking for it there?

I tried a number of msbuild configuration combinations. The one you see above is the most complete. I also tried without ToolsVersion and TargetFrameworkVersion. Other than that my solution/project configuration is the very default one. I just click File>New Project, select empty sharepoint project and then I add a new feature.


Dimitris Papadimitriou, Software Development Professional


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>