"wwwroot"中的某些文件文件夹未在ASP.NET Core Web部署中发布 [英] Some files in "wwwroot" folder are not published in ASP.NET Core web deploy

查看:87
本文介绍了"wwwroot"中的某些文件文件夹未在ASP.NET Core Web部署中发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2017中使用ASP.NET Core 2.0.

I am using ASP.NET Core 2.0 in Visual Studio 2017.

当我在 IIS Express 中进行调试时,我的网站运行正常.但是,当将站点部署到IIS服务器时,并不会部署wwwroot中的所有文件夹和文件.我已经看过.csproj文件,但是我不知道如何确保它部署了所有文件和文件夹.

My site works fine when I hit debug in IIS Express. But when deploying the site to IIS server, not all the folders and files in wwwroot are deployed. I have looked at the .csproj file, but I don't know how to make sure it deploys all files and folders.

推荐答案

我解决了这个问题.解决方案是编辑.csproj文件.

I solved the issue. The solution is to edit the .csproj file.

删除所有与wwwroot相关的 ItemGroup 标记,然后添加以下标记:

Remove all the ItemGroup tags related to wwwroot and then add this one:

<ItemGroup>
    <None Include="wwwroot\*" />
</ItemGroup>

星号将包含所有子文件夹和文件.

The asterisk will include all the subfolders and files.

这篇关于"wwwroot"中的某些文件文件夹未在ASP.NET Core Web部署中发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆