简体   繁体   English

如何在IIS 7中发布ASP.NET MVC 2页面?

[英]How to publish a ASP.NET MVC 2 page in IIS 7?

I have an ASP MVC 2 page that works perfectly using the development server that comes with visual studio 2010, but all my attempts to publish it in a server (windows 2008) resulted in fail so far. 我有一个ASP MVC 2页面,可以很好地使用Visual Studio 2010附带的开发服务器正常工作,但是到目前为止,我所有试图将其发布到服务器(Windows 2008)中的尝试都失败了。 I googled it various times, but none of the tutorials solved my problem. 我用Google搜索了很多次,但是没有一个教程解决了我的问题。 There's some errors, not just one: 有一些错误,而不仅仅是一个:

  • When I run the silverlight test page (an asp page that comes with the project) the parser complains of my mvc include in web.config. 当我运行silverlight测试页(项目随附的asp页)时,解析器抱怨我的mvc包含在web.config中。 Following a tutorial I transfered the dlls to the bin folder, which resulted in ... nothing. 按照教程,我将dll转移到bin文件夹中,结果是……什么都没有。
  • Anyway I try to run my MVC page, an error message comes to my screen. 无论如何,我尝试运行我的MVC页面,屏幕上都会出现一条错误消息。

What should I do to have this page working? 要使该页面正常工作我该怎么办?

When I tried to put my first website online I had the same problem. 当我尝试将我的第一个网站放到网上时,我遇到了同样的问题。 It runs perfectly on the test but not in IIS 7. 它可以在测试中完美运行,但不能在IIS 7中运行。

My mistake was that I forgot a \\ at the and of the Physical path in IIS 7. 我的错误是我在IIS 7中的和路径中忘记了\\。

Don't know if you have the same problem, but you can check it. 不知道您是否遇到相同的问题,但是可以检查一下。

The problem as that MVC was not installed, and it took me a while to figure out that it was necessary. 由于未安装MVC,因此我花了一段时间才弄清楚这是必要的。 Also, the person who deals with the IIS set the wrong folder to be a Web Application. 另外,处理IIS的人将错误的文件夹设置为Web应用程序。 Thanks anyway guys! 谢谢大家!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM