HaBo
HaBo

Reputation: 14317

MsBuild to build and create a deployment package

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?

Upvotes: 3

Views: 4308

Answers (3)

KMoraz
KMoraz

Reputation: 14164

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).

Upvotes: 2

weir
weir

Reputation: 4771

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).

Upvotes: 0

chief7
chief7

Reputation: 14393

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

/p:VisualStudioVersion=11.0

Upvotes: 0

Related Questions