【发布时间】:2014-06-26 19:03:22
【问题描述】:
我有一个带有以下发布设置的基本 ASP.NET Web 应用程序:
- 发布到文件系统。
- 在发布前删除所有现有文件 - 勾选
- 发布期间预编译 - 未勾选
- 从 App_Data 文件夹中排除文件 - 勾选
虽然发布确实按预期工作,但似乎发布了很多额外的包袱。
\bin
Web.config
Web.Debug.config
Web.Release.config
WebServer.dll
\Properties
AssemblyInfo.cs
\PublishProfiles
Release.pubxml
MyWebForm.aspx
MyWebForm.aspx.cs
MyWebForm.aspx.designer.cs
Web.config
Web.Debug.config
Web.Release.config
WebServer.csproj
WebServer.csproj.user
除此之外,我可以删除所有内容:
\bin
WebServer.dll
MyWebForm.aspx
MyWebForm.aspx.cs
MyWebForm.aspx.designer.cs
Web.config
所以,我的问题有两个:
首先,为什么使用发布选项,发布各种内容,例如 *.csproj 文件或 bin 目录中的 *.config 文件等,因为该站点似乎运行良好没有这个包袱就好了。公开这些文件的目的是什么?
其次,有没有办法将发布操作配置为只发布项目所需的最少文件?
【问题讨论】: