【问题标题】:ASP.NET Web Site publish with Visual Studio 2013 in .NET 4.5.2ASP.NET 网站在 .NET 4.5.2 中使用 Visual Studio 2013 发布
【发布时间】:2015-06-05 13:28:18
【问题描述】:

我将一个 asp.net 网站应用程序从 .NET 4.0 中的 Visual Studio 2010 迁移到了带有 .NET 4.5.2 的 Visual Studio 2013。

当网站在 Visual Studio 2013 中发布时,它不会在 bin 文件夹中生成任何应用程序 dll 或编译文件,但它会在 Visual Studio 2010 中正确发布。

我尝试使用带有选项 -errorstack 的 aspnet_compiler.exe 在命令中发布网站。它正在成功编译,没有在 bin 文件夹中抛出任何错误或输出。

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /website -p C:\WebsitePhysicalPath -c -errorstack C:\targetDir

非常感谢您对此的任何帮助。

【问题讨论】:

  • 当您在 Visual Studio 2013 中发布时,“输出”窗口会显示什么?如果发布成功,它应该以这样的方式结束:========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

标签: asp.net aspnet-compiler


【解决方案1】:

你应该在 aspnet 编译器之前使用 msbuild

 C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\Projects\testPublish\testPublish.csproj  /p:DeployOnBuild=true /property:Configuration=Release
 if exist "C:\PublishDirectory" rd /q /s "C:\PublishDirectory"
 C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p C:\Projects\testPublish\obj\Release\Package\PackageTmp -c C:\PublishDirectory
 cd C:\PublishDirectory\bin
 del *.xml
 del *.pdb

【讨论】:

  • 在 Visual Studio 中创建网站时没有创建 .csproj 文件
  • 如果您使用解决方案“testPublish.sln”,您可以更改 testPublish.csproj 文件
  • 将 .csproj 更改为 .sln 没有帮助。谢谢:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-29
  • 2023-04-02
  • 1970-01-01
  • 2018-03-28
  • 1970-01-01
  • 2014-11-23
相关资源
最近更新 更多