在IIS7.5上部署MVC4应用程序(Deploying MVC4 App on IIS7.5)
我正在尝试在IIS7.5上部署MVC4,但我有一些问题。 我有
- 安装了Windows Server 2008 R2
- 安装了.NET 4.0
- 安装了Web部署64工具
- 安装IIS 7.5角色(使用ASP.NET和管理服务)
- 我将域名添加到.hosts文件,该文件指向服务器IP地址(开发机器)
- 我创建了支持.NET 4.0的Web池
- 我创建了指向C:\ www \ AppName的网站,并将该网站添加到以前的AppPool
- 我创建了C:\ www \ AppName文件夹并部署到该文件夹MVC4 app(visual studio项目中的发布方法)
- 我开始了网站
- 我添加域名到IE,我得到这个错误
HTTP错误403.14 - 禁止Web服务器配置为不列出此目录的内容。
我读了一些文章,我默认在Web.Config文件中
<system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true" /> </system.webServer>
我也试过了
<system.webServer> <modules> <remove name="UrlRoutingModule-4.0" /> <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> </modules> <validation validateIntegratedModeConfiguration="false" /> </system.webServer>
它给了我同样的错误,但如果我删除
<validation validateIntegratedModeConfiguration="false" />
它在两种情况下都给我这个错误
HTTP错误500.24 - 内部服务器错误检测到的ASP.NET设置不适用于集成管理管道模式。
我需要做些什么才能正确设置? 这是我的第一个MVC4项目,很少有用户使用Windows身份验证应用程序。
编辑 :解决方案是使用虚拟目录。 提示:VS 2010能够自行创建和配置虚拟目录。 (项目属性> Web>创建虚拟目录)
I'm trying to deploy MVC4 on IIS7.5 but i have some issues. I have
- installed Windows Server 2008 R2
- installed .NET 4.0
- installed Web Deployment 64 Tool
- installed IIS 7.5 role (With ASP.NET and Management Service)
- i added domain name to .hosts file which point to server ip addresses (development machine)
- i created web pool with .NET 4.0 support
- i created web site which point to C:\www\AppName and add that web site to previous AppPool
- i created C:\www\AppName folder and deploy to that folder MVC4 app (publish method in visual studio project)
- i started web site
- i added domain name to IE and im getting this error
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
I read some articles and i have by default in Web.Config file this
<system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true" /> </system.webServer>
I also tried
<system.webServer> <modules> <remove name="UrlRoutingModule-4.0" /> <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> </modules> <validation validateIntegratedModeConfiguration="false" /> </system.webServer>
It gives me same error, however if I remove
<validation validateIntegratedModeConfiguration="false" />
it gives me this error in both cases
HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
What i have to do to proper settings ? It is my first MVC4 project and application will be used few times by few users with windows authentication.
EDIT: Solution is to use Virtual Directory. TIP: VS 2010 is able to create and configure Virtual Directory itself. (Project properties > Web > Create Virtual Directory)
原文:https://stackoverflow.com/questions/27742813
最满意答案
这是更简单的解决方案。
- 创建控制台应用程序。
- 在生成的项目上打开属性
- 转到应用程序选项卡
- 将输出类型更改为Windows应用程序
这样你就不必隐藏任何窗口,因为你不会创建任何窗口。
Here's even simpler solution.
- Create a console application.
- Open the Properties on the generated project
- Go to the Application tab
- Change the Output type to Windows Application
This way you don't have to hide any windows because you don't create any.
相关问答
更多-
这个确切的事情发生在我身上。 你有ReSharper吗 如果是这样,我在这里找到的解决方案可能适用于您。 从亚历山大的评论在接受的答案: 尝试清理R#缓存C:\ Users {用户名} \ AppData \ Local \ JetBrains \ ReSharper \ v8.2 \ SolutionCaches \然后重新打开解决方案 从下面的评论 - 这是%userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches为那些想要Wi ...
-
它们在VS2012上不再受支持。 http://blogs.msdn.com/b/buckh/archive/2011/03/17/visual-studio-setup-projects-vdproj-will-not-ship-with-future-versions-of-vs.aspx They are not supported anymore on VS2012. http://blogs.msdn.com/b/buckh/archive/2011/03/17/visual-studio-set ...
-
我刚刚找到了解决方案: 手动安装VS-Extension。 在某些方面,VS-Extension没有安装。 您可以手动进行。 位于C:\Program Files (x86)\Microsoft SDKs\TypeScript\0.8.0.0称为TypeScriptLanguageService.vsix 。 尝试运行此文件。 它应该安装TypeScript扩展。 如果您正在运行基于x86的系统,请尝试查看C:\Program Files\Microsoft SDKs\TypeScript\0.8.0.0 ...
-
在项目中的XML文件: 控制台应用包含:
Exe WinForms应用程序包含:WinExe 图书馆(.dll)项目包含:Library 并且不包含aASP.NET和WCF项目包含: {603c0e0b-db56-11dc-be95-000d561079b0};{349c5 ... -
要在Visual Studio 2012中使用InstallShield Limited Edition创建安装项目,请观看此视频 。 无法安装服务的InstallShield限量版。 “ISLE是迄今为止最糟糕的安装程序选项,升级后的阅读付费版本在大多数情况下使用最多且不可能是麻烦的,InnoSetup,Nullsoft,Advanced,WiX或任何其他安装程序更好,如果您做了一个调查,你会看到没有人在使用ISLE,我不知道你们为什么继续与InstallShield联系,它损害了你的信誉,任何开发者值得 ...
-
这是更简单的解决方案。 创建控制台应用程序。 在生成的项目上打开属性 转到应用程序选项卡 将输出类型更改为Windows应用程序 这样你就不必隐藏任何窗口,因为你不会创建任何窗口。 Here's even simpler solution. Create a console application. Open the Properties on the generated project Go to the Application tab Change the Output type to Windows ...
-
C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ Tools 这是一个VS2015目录,你有版本15又名VS2017。 确保首先找到VS2017安装目录,它与之前的VS版本有很大的不同。 从...开始 C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ 那里有一个与版本名称匹配的子目录,如Enterprise,Professional,Community。 导航到该目 ...
-
如果您有TestDriven.net,那么您只需单击该方法即可运行。 您不必使用Test或TestMethod属性或类似的东西来装饰方法。 testdriven.net有个人版,免费。 If you have a TestDriven.net then all you have to do is to just click on the method and it will run. You don't have to decorate the method with Test or TestMethod ...
-
MSDN上的这篇文章提供了您需要的信息: http : //msdn.microsoft.com/en-us/library/6db0hwky.aspx 可以使用此工具创建多项目模板以帮助: http : //vsix.codeplex.com/ This article on MSDN has the information you need: http://msdn.microsoft.com/en-us/library/6db0hwky.aspx Multi-project templates can ...
-
您可以创建一个多项目模板 ,然后创建“根向导” ,其中显示一些允许项目选择的UI,然后是“子向导”,用于每个项目,在不需要时使用模板创建新项目时, 抛出一个 RunStarted方法中的WizardBackoutException 。 但这肯定有点麻烦。 每个项目创建一个模板要容易得多。 You can create a multi-project template, then create "root wizard" which shows some UI to allow project selecti ...