0

Basically, I'm trying to build my project using MSbuild inside the .NET framework.

NOTE: Visual Studio is not installed on the Windows server, however, all necessary .NET framework is installed.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild "D:\myCProject\WebApplication7.csproj" /p:Configuration=Debug;DeployOnBuild=True;PackageAsSingleFile=False;outdir=D:\myCProject\Publish

the above command is what I'm trying to run in the MSbuild.I'm getting then this error.

Build started 10/11/2017 12:47:13 PM.
Project "D:\myCProject\WebApplication7.csproj" on node 1 (default targets).
D:\myCProject\WebApplication7.csproj(212,3): error MSB4019: The imported projec
t "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\
Microsoft.WebApplication.targets" was not found. Confirm that the path in the <
Import> declaration is correct, and that the file exists on disk.
Done Building Project "D:\myCProject\WebApplication7.csproj" (default targets)
-- FAILED.


Build FAILED.

"D:\myCProject\WebApplication7.csproj" (default target) (1) ->
  D:\myCProject\WebApplication7.csproj(212,3): error MSB4019: The imported proj
ect "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplication
s\Microsoft.WebApplication.targets" was not found. Confirm that the path in the
 <Import> declaration is correct, and that the file exists on disk.

    0 Warning(s)
    1 Error(s)

Any ideas?

I need to build the project with MSBuild without Visual Studio without errors during the build.

Thanks

I.PSARN
  • 123
  • 1
  • 1
  • 5
  • 2
    Duplicate of [this](https://stackoverflow.com/questions/3980909/microsoft-webapplication-targets-was-not-found-on-the-build-server-whats-your) and [this](https://stackoverflow.com/questions/17433904/v11-0-webapplications-microsoft-webapplication-targets-was-not-found-when-file-a)? – Ivan Milosavljevic Oct 11 '17 at 19:24
  • This is not duplicate question, the other problems were for projects using VS. my problem involves MSBuild without Visual Studio. – I.PSARN Oct 11 '17 at 19:31
  • You're going to find you need VS. It's pretty much essential. – mason Oct 12 '17 at 04:01
  • This is already answered in my first post but... 1. Solution: install MSBuild tools on build machine from [here](https://www.microsoft.com/en-us/download/details.aspx?id=40760). 2. Solution: Copying the following folder from your dev machine to your build server fixes this if it's just web applications: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications. Second solution is to upgrade to VS 2015/2017 and to install MS Build Tools on build machine. – Ivan Milosavljevic Oct 15 '17 at 18:16

0 Answers0