ASP.NET MVC 4 and Web API in Azure - No HTTP resou

2019-07-21 14:31发布

Using Visual Studio 2012, I created a simple Windows Azure Project (Cloud project) for which contains a ASP.NET MVC 4 website. I didn't change anything to the template and I simply try to deploy it using Azure Website. I imported the "publishing profile" from Windows Azure Dashboard into my project and deployed (using Visual Studio).

At the very end of the deployment process I am getting the following message: "failed to open 'http://mysite.azurewebsite.net'. Exception:Class not registered". I can only click "Ok" on that dialog. Any idea why I am seeing this message?

When I look at the Output Window, I see that the deployment succedded. I go the a Web API url and I am getting "No HTTP resource was found that matches the request URI 'http://mysite.azurewebsites.net/api/values'". What puzzle me is that I can access that same url on my local environment.

What am I missing? Thanks!

3条回答
神经病院院长
2楼-- · 2019-07-21 14:55

I could access using my Azure website using ASP.NET Web API. If you use default MVC4 Web API template, please access "http://[yoursite].azurewebsites.net/api/Values/".

My Environment is below. - Visual Studio 2012 - ASP.NET MVC4

查看更多
干净又极端
3楼-- · 2019-07-21 14:58

You don't need to create a cloud project to use Azure Websites. You can simply create an MVC app and then use git deploy or even FTP to push the site to Azure

查看更多
兄弟一词,经得起流年.
4楼-- · 2019-07-21 15:05

Make sure that you referenced the latest version of WindowsAzure related assemblies in your project.

Microsoft.WindowsAzure.Diagnostics 2.0 (and not 1.8)
Microsoft.WindowsAzure.ServiceRuntime 2.0 (and not 1.8)
查看更多
登录 后发表回答