Visual Studio 2012 Web Publish 不复制文件 [英] Visual Studio 2012 Web Publish doesn't copy files

查看:22
本文介绍了Visual Studio 2012 Web Publish 不复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VS 2012 中有一个 Web 应用程序项目,当我使用 Web 发布工具时,它会成功构建,但不会将任何文件复制到发布目标(在本例中为文件系统).

I have a Web Application project in VS 2012 and when I use the web publishing tool it builds successfully but doesn't copy any files to the publish target (File System in this case).

如果我查看构建输出,我可以看到所有内容都被正确复制到 objReleasePackagePackageTmp 中,但是我在构建输出中看到的只是:

If I look at the build output I can see everything gets copied over to objReleasePackagePackageTmp correctly but then all I see in the build output is this:

4>完成构建项目{Project}.csproj".
4>正在删除现有文件...
4>发布文件夹/...
4> ========== 构建:3 次成功,0 次失败,1 次更新,0 次跳过 ==========
========== 发布:1 成功,0 失败,0 跳过 ==========

4>Done building project "{Project}.csproj".
4>Deleting existing files...
4>Publishing folder /...
4> ========== Build: 3 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

即使它说发布成功,目标目录中也没有用于发布的文件.

Even though it says the publish succeeded there are not files in the target directory for the publish.

我在多个项目中看到过这种情况,有时似乎是解决方案/平台配置导致了这个问题,但我一直无法查明具体原因.

I have seen this in multiple projects and sometimes it seems like the Solution/Platform configurations cause this problem but I haven't been able to pinpoint an exact cause for this.

有没有其他人看到这种情况发生或有关于如何使其正常工作的想法?

Has anyone else seen this happening or have an idea on how to get this working correctly?

更新:

我可能已经找到了解决方法.我刚刚再次发生这种情况,并且我正在处理发布设置.一旦我将设置"选项卡上的选定配置更改为另一种配置,然后又回到我想要使用的配置,我的所有文件又开始发布.希望这在未来适用于其他项目.

I may have found a workaround for this. I just had this happen again and I was messing around with the publish settings. Once I changed the selected Configuration on the Settings tab away to another configuration and then back to the one I wanted to use all my files started publishing again. Hopefully this works on other projects in the future.

更新 2:

我在 Microsoft Connect 上发布了一个错误,并收到了 VS Web 开发人员团队的一名开发人员的回复.他说他们已经在内部版本中修复了这个问题,并且很快就会发布发布工具的更新来解决这个问题.

I posted a bug on Microsoft Connect and heard back from a developer on the VS Web Developer team. He said they have fixed this issue in their internal builds and will releasing an update to the publish tool soon that will fix this problem.

更新 3:

最近在 Visual Studio 2012 Update 2 中修复了这个问题

This has been recently fixed with Visual Studio 2012 Update 2

推荐答案

这可能是由使用 vs2012 的 RC 创建的解决方案/项目引起的.这几个月前发生在我身上,并通过确保我的解决方案构建配置与我的项目配置匹配来解决问题...

This may be caused by solutions/projects that were created with the RC of vs2012. This happened to me months ago and fixed the problem by making sure my solution build configurations matched my project configurations...

我最近在使用 VS2012 Express for Web 打开最初在 vs2012RC 中创建的相同解决方案时遇到了同样的问题.我完全按照原始海报的建议做了,它解决了我的问题.

I just recently experienced the same problem when opening the same solution originally created in vs2012RC with VS2012 Express for Web. I did exactly what the original poster suggested and it fixed my problem.

这是引导我找到答案的线索:

Here is the thread that lead me to the answer:

connect.microsoft.com/VisualStudio/feedback/details/746321/publish-web-application-fails

上面对话中对我有帮助的相关回答是:

The pertinent response from the conversation above that helped me was:

由 Microsoft 于 2012 年 6 月 13 日下午 12:00 发布,您好,安德鲁,

Posted by Microsoft on 6/13/2012 at 12:00 PM Hi Andrew,

这是我们处理解决方案配置与项目配置.我们错误地认为他们是相同(例如解决方案的 Release|x86 会将每个项目设置为Release|x86 也是),这导致我们使用了错误的构建用于发布文件的属性.

This was a bug in how we handle the solution configuration vs. the project configuration. We incorrectly assumed that they would be the same (e.g. Solution's Release|x86 would have each project set to Release|x86 as well), which caused us to use the wrong build properties for publishing files.

解决方法是进行解决方案配置和构建配置匹配.此问题将在下一个版本中修复Visual Studio 2012.

The workaround is to make the solution configuration and build configuration match. This issue will be fixed in the next release of Visual Studio 2012.

谢谢,- Jimmy Lewis SDET,Visual Web 开发团队

Thanks, - Jimmy Lewis SDET, Visual Web Developer team

这篇关于Visual Studio 2012 Web Publish 不复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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