开发者

Cannot convert existing ASP.NET MVC 2 solution to Azure Web Role in Visual Studio 2010

I've been working on an ASP.NET MVC 2 (.NET 4.0, Visual Studio 2010) application for a while and have decided that I would like to deploy it as an Azure application.

After installing the latest (June 2010) Azure tools (through Visual Studio itself) I've added a blank CloudService to my solution. Whenever I try to add a "Web Role Project in Solution", however, I get the following error:

An error occurred trying to load the project properties window. 
Close the window and try again.
Cannot evaluate the item metadata "%(FullPath)". 
The item metadata "%(FullPath)" cannot be applied to the path 
"obj\Debug|Any CPU\Cloud.dll". Illegal characters 开发者_运维知识库in path.  
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets

I get this same error whenever I try to Save All or view the properties page for the CloudService project.

I imagine it's having trouble with the Debug|Any CPU part of the path, but can I remove it or word around it?

Thanks in advance


Well, what do you know. When had already sort of given up on this, seeing as how I could run en deploy the application anyway I decided to try one last time and ended up finding the solution on this article:

http://tomkrueger.wordpress.com/2010/07/27/azure-deployment-issue-after-upgrading-to-visual-studio-2010-and-net-4-0/

The problem started because I actually added an Azure project to an existing ASP.NET MVC solution there were some unnecessary settings left over in the web.csproj file.

All I had to do was open web.csproj in notepad and remove all occurrences of the <PlatformTarget> element.

My MVC prjoject was x86 and of course Azure works on x64 only. Even though I had the platform target set up as AnyCPU somehow Azure couldn't quite get along with it.


Have you downloaded the latest Azure SDK? .NET 4 was not supported before the June 2010 version of the SDK.

Windows Azure Software Development Kit (June 2010)

Windows Azure Tools for Microsoft Visual Studio 1.2 (June 2010)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜