3
votes

I was trying to use the following command to build my solution, but that was giving me an error saying MSBuild target package not found

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\Users\FullPath\SolutoinName.sln" /T:Build;package /p:Configuration=DEBUG /p:OutputPath="obj\DEBUG" /p:DeployIisAppPath="/bidmc-defaul" /p:VisualStudioVersion=10.0

I have tried MSBuild target package not found but that did not help, then I removed package from target and ran the command and it was successful

Then I ran the following command to create a package zip

"C:\Program Files (x86)\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:package="C:\Users\Full Path\Website\obj\Debug_PublishedWebsites\defaul_Package\myPackage.zip" -dest:auto,computerName=localhost -allowUntrusted=true

Now this says object of type package and path cannot be created, the zip package could not be loaded, could not find part of the path

Update


fix to my first command to create package. I was giving my solution name SolutoinName.sln, I replaced it with my main project in solution myproject.csproj, with corresponding paths. That resolved my first error.

now second error has changed to "the applicatoin pool that you are trying to use has the managedRuntimeVersion property set to v4.0 the application required 4.5"

How should I address this, just install .NET 4.5 on build machine?

3

3 Answers

2
votes

It seems you're attempting to build a VS2012.NET 4.5 or higher solution with MSBuild 4.0. That's supported, provided you install the full .NET 4.5 Framework and the required SDK's and targeting packs for VS 2012, VS 2013 and more.

Alternatively, you can upgrade to MSBuild 2013 v12.0 (for VS 2013 solutions support) or MSBuild 2015 v14.0 (VS 2015).

0
votes

You need to change the VisualStudioVersion to 11 on the MSBuild call.

/p:VisualStudioVersion=11.0
0
votes

Use IIS Manager to upgrade the .NET Framework version assigned to your app pool (or change your project properties to downgrade the .NET Framework version your web application targets).