Web 应用程序项目 (MVC) 中发布失败

发布于 2024-07-12 07:12:26 字数 225 浏览 4 评论 0原文

我通常使用 VS 2008 中的“发布”功能来获取可以发布到我的网站的正确文件等。 但有时发布会失败,根本没有任何好的错误消息。 我知道这可能有几个不同的原因,但我现在开始对此感到非常厌倦。

谁能教我如何从命令行构建网站? 正如我所说,这是一个 MVC 项目。 我可以使用 aspnet_compiler 来实现此目的吗? 我应该使用哪些参数来模拟与“发布”相同的行为?

I usually use the "Publish" feature in VS 2008 to get the correct files and so on that I can publish to my website. But from time to time publish fails without any good error message at all. I know that it can be a couple of different reasons but I am starting to grow really tired with this now.

Can anyone teach me how to build the website from the command line? As I said it is a MVC project. Can I use the aspnet_compiler for this? What parameters should I use to simulate the same behavior as a "Publish"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

凉风有信 2024-07-19 07:12:26

我好像明白了这一点。 不是失败部分,而是我制作了一个命令行构建脚本。 我在这里发布了相关博客

我在此处粘贴代码时遇到了麻烦,但所有信息都在博客文章中。

I kind of figured this out. Not the fail part but i made a command line build script instead. I blogged about it here.

I had troubles pasteing the code here but all info is in the blog post.

情释 2024-07-19 07:12:26

解决方案!!!!

显示输出窗口。 VS 2005 - 查看 -> 输出。

当你发布它时,它会给你所有的错误。

SOLUTION!!!!

Display the output window. VS 2005 - View -> Output.

When you publish it will give you all the errors.

甜柠檬 2024-07-19 07:12:26

在只是发布到本地目录的正常网络项目中,我偶尔会遇到同样的问题。

因此不需要 FP 并且目录权限永远不会改变。 它有时会起作用,然后就会失败。 输出控制台对于故障排除毫无用处。 它会在下一行说构建成功,然后发布失败。 记录结束。

没有任何关于发布失败原因的好消息是非常烦人的。 这是VS 2008,你会认为他们至少可以提供一个提示。

我做了两件事来解决这个问题。

  1. 在“用本地副本替换匹配文件”和“发布前删除所有现有文件”选项之间切换。

  2. 重新启动 IDE。

发布到不同的目录、清理然后构建以及停止 IIS 都不起作用。

I have the same problem occasionally in a normal web project just publishing to a local directory.

So no FP needed and directory permissions never change. It will work sometimes and then just fail. The Output console is useless for trouble shooting. It will say build succeeded and then publish failed on the very next line. End of logging.

Not having any good message as to why the publish fails is extremely annoying. This is VS 2008, you'd think they can at least provide a hint.

There are 2 things that I have done to get around the problem.

  1. Toggle between the "Replace matching files with local copies" and "Delete all existing files prior to publish" options.

  2. Restart the IDE.

Publishing to a different directory, a clean and then build, and stopping IIS did not work.

梦中楼上月下 2024-07-19 07:12:26

我遇到了同样的问题。 在查看了 Stuck 发布的博客链接上的评论后,我尝试使用 TortoiseSVN 的导出功能来获取代码的干净副本,而无需 svn 管理内容。 从那里开始进行编译和发布。

不知道这是否与您的问题相同,但我们在这里确实使用了 SVN、TortoiseSVN 和 AnkhSVN。 如果您有相同的设置,可能值得一试。

我知道这篇文章对于最初的问题来说有点晚了 - 但这是谷歌上的最佳结果之一,所以我认为其他遇到这个问题的人可能会发现对我有用的东西有点运气。

I ran into this same problem. After looking around at the comment's on Stuck's blog link he posted I tried using TortoiseSVN's export function to get a clean copy of the code without the svn admin stuff. Doing a compile and publish worked from there.

Don't know if this is the same as your problem, but we do use SVN, TortoiseSVN, and AnkhSVN here. If you have the same setup it might be worth a shot.

I know this post is coming a bit late for the original question - but this was one of the top results on google so I figured anyone else having this problem might find a bit of luck with what worked for me.

谈场末日恋爱 2024-07-19 07:12:26

我遇到了同样的问题,但不知道原因,所以无法重现。

但是,如果您在解决方案中创建第二个 MVC 项目并将其发布,则另一个项目也将重新开始工作。

至少在我的例子中这是有效的。

I got the same problem but I don't know the cause so I cant reproduce it.

But if you create a second MVC Project in your solution and publish that, the other one will start working again too.

At least in my case this worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文