简体   繁体   English

安装后设置 .net 5 项目没有 web.config

[英]Setup .net 5 project without web.config after installation

I have created a web project (.net 5) in this way:我以这种方式创建了一个 web 项目(.net 5): 在此处输入图像描述

And now, I'm trying to create a Web Setup for my.Net 5 (application console) web project.现在,我正在尝试为 my.Net 5(应用程序控制台)web 项目创建 Web 设置。 As remarked in this link , I've added published items of my website project in web setup. 如此链接所述,我已在 web 设置中添加了我的网站项目的已发布项目。

When I generate my setup and install my application, I have NO web.config created and because of that, I have 403.14 error (when I push it manually I have no more error.).当我生成我的设置并安装我的应用程序时,我没有创建web.config ,因此,我有 403.14 错误(当我手动推送它时,我没有更多错误。)。

I don't know why web.config is created automatically in handy publish from VS2019 but not in Setup Web project?我不知道为什么 web.config 是在 VS2019 方便发布时自动创建的,但不是在 Setup Web 项目中? Do I have to do some configuration in my IIS or Pool or maybe in my website?我是否必须在我的 IIS 或 Pool 或我的网站中进行一些配置? Any help or idea?有什么帮助或想法吗?

PS App Pool is set to No Managed Code PS 应用程序池设置为无托管代码

Thanks谢谢

I need this web.config:我需要这个 web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\MYAPP.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

A console application wont have a web.config as it's not usually built to be web hosted.控制台应用程序不会有 web.config,因为它通常不是为托管 web 而构建的。

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

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