发布后剩余的不需要的文件
当我在 ASP.NET MVC 网站上执行“发布”时,我在发布文件夹中发现不必要的空文件夹。
这很烦人,因为我必须手动删除它们,这样它们就不会通过 FTP 上传。
即使我选择以下单选按钮,也会发生这种情况:
- 在发布之前删除所有现有文件
- 复制
- 仅运行此应用程序所需的文件
它不会复制每个文件夹,仅复制一两个随机文件夹。 我不知道为什么它选择只复制这些文件夹,而不复制其他文件夹。 它们不是系统文件夹或任何东西——我自己制作的。
为什么会发生这种情况?
When I do a 'Publish' on my ASP.NET MVC website, I'm finding unnecessary empty folders in the publish folder.
This is annoying because I have to manually delete them so they don't get uploaded through FTP.
This happens even when I select the following radio-buttons:
- Delete all existing files prior to publish
- Copy
- Only files needed to run this application
It doesn't copy every folder, only one or two random folders. I have no idea why it chooses to copy just these folders, but not the others. They're not system-folders or anything - I made them myself.
Why is this happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是发布向导的工作方式。 如果您想更好地控制 Web 项目的部署方式,如果您有 Visual Studio 开发人员版本,则可以创建 Web 部署项目。 (也许也很专业,我不确定。)
看起来你也可以下载它?
http://www.microsoft.com/downloads/details.aspx microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en
It's just the way the publish wizard works. If you want more control over how a web project is deployed you can make a web deployment project if you have developer edition of Visual Studio. (Perhaps professional as well I'm not sure.)
Looks like you might be able to download it too?
http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en
如果发布向导中包含也包含代码的子文件夹,则发布向导似乎包含空的根级自定义文件夹。 示例:
将导致在您发布到的位置中显示一个空的“Folder1”。 我认为这是文件夹上的“命名空间提供程序”属性和 csproj 文件的
元素的产物。The Publish Wizard seems to include empty root-level custom folders if they contain subfolders that also contain code. Example:
Will result in an empty "Folder1" showing up in the location you publish to. I think this is an artifact of the "Namespace Provider" property on folders and the
<Compile Include="Folder1\Subfolder2\ChildClass1.cs" />
elements of the csproj file.