Visual studio 2015 MVC 6-在IIS上获取404错误
这就是我所能得到的 状态代码:404;找不到 这里是环境Visual studio 2015 MVC 6-在IIS上获取404错误,visual-studio-2015,asp.net-core,asp.net-core-mvc,Visual Studio 2015,Asp.net Core,Asp.net Core Mvc,这就是我所能得到的 状态代码:404;找不到 这里是环境 IIS 7.5 Windows 2008 R2 已安装ASP.NET 5 RC和HttpPlatformHandler …以及我所做的一切 1) 已检查web.config中stdoutLogFile指向的日志目录。没有看到任何错误。其中有很多: info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1] Request starting HTTP/1.1 GET <webs
- IIS 7.5
- Windows 2008 R2
- 已安装ASP.NET 5 RC和HttpPlatformHandler
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 GET <websiteName>
4) 本地出版。复制到服务器。网站指向wwwroot目录。Approt坐在它旁边
5) processPath指向“.\approot\web.cmd”
6) 与DNX版本DNX-clr-win-x86.1.0.0-rc1-update1一起发布。还尝试了相同的64位版本
7) 已安装HttpPlatformHandler
8) 检查了IIS错误日志,没有看到任何有趣的内容
下一步我应该试试什么
更新
我已经映射了这些环境变量
DNX_HOME - C:\Users\<user>\.dnx
DNX_PACKAGES - C:\Users\<user>\.dnx\packages
DNX_PATH - C:\Users\<user>\.dnx\bin\dnvm.cmd
DNX\u HOME-C:\Users\\.DNX
DNX\U软件包-C:\Users\\.DNX\PACKAGES
DNX_路径-C:\Users\\.DNX\bin\dnvm.cmd
VisualC++ 2012可重新分发VisualStudio 4更新4。 < P>)每次在故障处理步骤中循环应用程序池。
2) 尝试一个大大简化的应用程序。如果您仍然收到404,那么我们知道主机问题而不是应用程序问题
下面的超级简单应用程序在IIS中为我们工作
C:/App00/Startup.cs
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
namespace App00
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.Run(async context =>
{
await context.Response.WriteAsync("Hello from RC1!");
});
}
}
}
C:/App00/project.json
{
"dependencies": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-*"
},
"frameworks": {
"dnx451": {}
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
}
}
Physical Path C:\App00\bin\output\wwwroot
C:/App00/wwwroot/web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*"
modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%"
stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
IIS配置
{
"dependencies": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-*"
},
"frameworks": {
"dnx451": {}
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
}
}
Physical Path C:\App00\bin\output\wwwroot
1) 每次执行故障排除步骤时回收应用程序池
2) 尝试一个大大简化的应用程序。如果您仍然收到404,那么我们知道主机问题而不是应用程序问题
下面的超级简单应用程序在IIS中为我们工作
C:/App00/Startup.cs
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
namespace App00
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.Run(async context =>
{
await context.Response.WriteAsync("Hello from RC1!");
});
}
}
}
C:/App00/project.json
{
"dependencies": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-*"
},
"frameworks": {
"dnx451": {}
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
}
}
Physical Path C:\App00\bin\output\wwwroot
C:/App00/wwwroot/web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*"
modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%"
stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
IIS配置
{
"dependencies": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-*"
},
"frameworks": {
"dnx451": {}
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
}
}
Physical Path C:\App00\bin\output\wwwroot
当您收到404?打开的项目属性时,您将导航到哪个URL。选择选项卡Web。将“当前页面”更改为“特定页面”。文本框留空。@Shaun Luttin,我得到404和任何URL。尝试了许多变体,包括主机名、控制器和索引的变体。什么都没用。@AlexeyObukhov,我的项目属性中没有“web”选项卡。我有应用程序、构建和调试。在Debug选项卡中,我将其设置为web并发布。不起作用。当您收到404?打开项目属性时,您将导航到哪个URL。选择选项卡Web。将“当前页面”更改为“特定页面”。文本框留空。@Shaun Luttin,我得到404和任何URL。尝试了许多变体,包括主机名、控制器和索引的变体。什么都没用。@AlexeyObukhov,我的项目属性中没有“web”选项卡。我有应用程序、构建和调试。在Debug选项卡中,我将其设置为web并发布。没用,谢谢!我的申请有问题。好东西。。。谢谢你的答题。请你也在投票上做标记好吗您是否在IIS中使用子应用程序?他们搞乱了MVCs的路由:我知道已经有一段时间了,但你解决了吗?我用你的Configure方法替换了我的Configure方法,它工作了,所以我认为MVC路由有问题。我没有在iis中使用子应用程序和虚拟目录。@FRules原始海报将答案标记为正确,因此我认为答案解决了他的问题。谢谢!我的申请有问题。好东西。。。谢谢你的答题。请你也在投票上做标记好吗您是否在IIS中使用子应用程序?他们搞乱了MVCs的路由:我知道已经有一段时间了,但你解决了吗?我用你的Configure方法替换了我的Configure方法,它工作了,所以我认为MVC路由有问题。我没有在iis中使用子应用程序和虚拟目录。@FRules原始海报将答案标记为正确,因此我认为答案解决了他的问题。