IIS 中的网站部署:IIS 无法访问目录?
Website Deployment in IIS : IIS can't access directories?
我在 Visual Studio 2019 年的 ASP.NET 核心中在我的本地机器上做了一个应用程序,然后在为我的文件系统部署之后,我将文件复制到服务器。同时,我在服务器(Windows 服务器)上创建了一个新的 IIS 站点,指示我想要的设置,包括使用 https。
但是,当我尝试访问站点时出现错误,显然 IIS 无法访问程序文件夹…
当我尝试在 IIS 的网站设置中导航并单击以查看连接字符串时,IIS 给出了图片中的错误。其实好像是路径有问题。 \?\C:\mydir\web.config
是什么意思?
谁能帮我解决这个错误?我确信我指出了 IIS 的正确路径。
我已经安装了.NET Hosting Bundle,上面的问题已经解决了。
但是,现在,我仍然无法访问我创建的网站。浏览器给出错误 DNS_PROBE_FINISHED_NXDOMAIN
。
这是我的 web.config 文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\MVF2.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 99f7528d-8954-427a-86a5-7124668717df-->
Program.cs 文件是:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace MVF2
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(options =>
{
options.Listen(IPAddress.Loopback, 8088, listenOptions =>
{
listenOptions.UseHttps("mycertificate.crt");
});
});
}
}
我在 Visual Studio 2019 年的 ASP.NET 核心中在我的本地机器上做了一个应用程序,然后在为我的文件系统部署之后,我将文件复制到服务器。同时,我在服务器(Windows 服务器)上创建了一个新的 IIS 站点,指示我想要的设置,包括使用 https。
但是,当我尝试访问站点时出现错误,显然 IIS 无法访问程序文件夹…
当我尝试在 IIS 的网站设置中导航并单击以查看连接字符串时,IIS 给出了图片中的错误。其实好像是路径有问题。 \?\C:\mydir\web.config
是什么意思?
谁能帮我解决这个错误?我确信我指出了 IIS 的正确路径。
我已经安装了.NET Hosting Bundle,上面的问题已经解决了。
但是,现在,我仍然无法访问我创建的网站。浏览器给出错误 DNS_PROBE_FINISHED_NXDOMAIN
。
这是我的 web.config 文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\MVF2.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 99f7528d-8954-427a-86a5-7124668717df-->
Program.cs 文件是:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace MVF2
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(options =>
{
options.Listen(IPAddress.Loopback, 8088, listenOptions =>
{
listenOptions.UseHttps("mycertificate.crt");
});
});
}
}