Can't run samples (e.g. ContactManager_Simple)

Topics: Web Api
Nov 30, 2011 at 6:28 PM

Here's the error message during build:

------ Build started: Project: System.Net.Http, Configuration: Release Any CPU ------

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2868,9): error MSB3021: Unable to copy file "D:\DevData\VSToolkits\WCFWeb\Src\WebAPI\obj\Release\System.Net.Http\System.Net.Http.dll" to "D:\DevData\VSToolkits\WCFWeb\Src\WebAPI\bin\Release\System.Net.Http.dll". Could not find file 'D:\DevData\VSToolkits\WCFWeb\Src\WebAPI\obj\Release\System.Net.Http\System.Net.Http.dll'.

I'm not sure what's going on. The active build configuration is set to debug, so why is it looking for the release version of System.Net.Http.dll?

I looked in the bin folder of the web project (ContactManager_Simple) and the System.Net.Http.dll is there with the rest of the dependencies.

Nov 30, 2011 at 6:43 PM

I checked the configuration manager for the solution, and System.Net.Http was indeed configured for the release build in the debug build for the solution.

Coordinator
Nov 30, 2011 at 9:47 PM

Are you seeing this in the latest changeset on CodePlex?

Daniel Roth

Nov 30, 2011 at 10:55 PM

Yup. The problem is in the solution file (WebAPI.sln):

		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Debug|Any CPU.ActiveCfg = Release|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Debug|Any CPU.Build.0 = Release|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Debug|x86.ActiveCfg = Release|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Release|Any CPU.Build.0 = Release|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
		{6D7A8E9E-1576-4E5D-AB2F-F3B540FD9AD1}.Release|x86.ActiveCfg = Release|Any CPU

That's the GUID for the System.Net.Http project. You can see that for the debug configuration, it's using the release build for both the Any CPU and x86 platform.

I also found a problem with the ContactManager_Advanced project. There's no reference to the System.Data.OData assembly. I had to add it to the project to get it to work.