简体   繁体   English

IIS 中的网站部署:IIS 无法访问目录?

[英]Website Deployment in IIS : IIS can't access directories?

IIS 设置 MySite:连接字符串 - 错误!

I did an Application in ASP.NET Core in Visual Studio 2019 in my local machine, then after deploying for my file system, I copied the files to the server.我在本地机器上的 Visual Studio 2019 中的 ASP.NET Core 中做了一个应用程序,然后在为我的文件系统部署后,我将文件复制到服务器。 Meanwhile, I created a new IIS site on the server (Windows Server) indicating the settings that I want, including the use of https.同时,我在服务器(Windows Server)上创建了一个新的 IIS 站点,指示我想要的设置,包括使用 https。

However, when I try to access the site an error occurs, and apparently the IIS can't access the program folder…但是,当我尝试访问该站点时发生错误,并且显然 IIS 无法访问程序文件夹......

When I try to navigate in the website settings in IIS and click to see the connection strings, the IIS gives me the error in the picture.当我尝试在 IIS 中的网站设置中导航并单击以查看连接字符串时,IIS 给了我图片中的错误。 In fact, it seems that there are a problem with the path.其实好像是路径有问题。 What does it mean \\\\?\\C:\\mydir\\web.config ? \\\\?\\C:\\mydir\\web.config是什么意思?

Anyone could give me help on how to solve this error?任何人都可以帮助我解决这个错误吗? I am sure that I indicated the correct path to IIS.我确信我指出了 IIS 的正确路径。

I have already installed the .NET Hosting Bundle and the above problem was solved.我已经安装了 .NET Hosting Bundle,上面的问题就解决了。 However, now, I continue to not be able to access the website I created.但是,现在,我仍然无法访问我创建的网站。 The browser gives error DNS_PROBE_FINISHED_NXDOMAIN .浏览器给出错误DNS_PROBE_FINISHED_NXDOMAIN

Here is my web.config file:这是我的 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-->

The Program.cs file is: 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");
                    });
                });
    }
}

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

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