0

A project gets built fine from Visual Studio without a problem from developers work station. Now we need to more it to DEV and UAT server. I've been struggling all day trying to get my ASP.NET project built with msbuild on a server with no Visual Studio installed (dev tools not permitted on servers) -

The type or namespace name 'Optimization' does not exist in the namespace 'System.Web'
The type or namespace name 'DotNetOpenAuth' could not be found

Couple attempts were made:

1. Install Windows SDK (http://msdn.microsoft.com/en-US/windows/hardware/hh852363) - appears there has been a lot of discussions from another Stackoverflow post (Related but not exactly - Build ASP.NET 4.5 without Visual Studio on Build Server). You'd also need to add to environment variables PATH

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools

(This did NOT help)

2: gacutil to install the dll's? (no vs command prompt - as said, no dev tool/Visual Studio permitted on server)

3: copy the dlls' to (i.e. same folder as MSBuild.exe): C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\ (This did NOT help)

4: Copy local = true (This did NOT help - the dll's apparent msbuild can't find already in bin folder of the ASP.NET application)

It appears to be a bug with msbuild - http://social.msdn.microsoft.com/Forums/vstudio/en-US/434abf1a-30db-4b13-8062-13755898dd71/msbuild-is-unable-to-link-to-a-webapplication-project?forum=msbuild

Anyone has experience with this?

Community
  • 1
  • 1

1 Answers1

0

Thank you for your feedback. This is an intentional change made in VS 2012. Projects excluded from a build configuration do not get built when you are building that configuration.

Yes, I've had experience with that. I discovered that excluding the project was handy in the IDE, I think I remember so that stable libraries don't get rebuilt so often; but the user could right-click on that project and build directly just once or when really needed.

But, it broke the MSBuild.exe command-line build, because those projects were not available at all.

One thing is to add conditional logic to the build file so it knows to set things differently for an interactive user or a pure build environment:

Condition="'$(BuildingInsideVisualStudio)' == 'true'"

I ended up eventually improving the build solution in my case, so I can't recall a specific example of the Excluded thing.

JDługosz
  • 5,592
  • 3
  • 24
  • 45