c# - 如何发布我的网站?

标签 c# asp.net visual-studio-2010

我有网站 MyProject 的解决方案。 我需要发布这个网站。 在弹出菜单中,我看到构建网站和发布网站

enter image description here

我将我的站点发布到目录并上传到 ftp。

但是网站报错:

The directory '/App_GlobalResources/' is not allowed because the application is precompiled.

如何发布我的网站?

更新: 我删除了 PrecompiledApp.config。

并报错

Compilation Error 
 Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

 Compiler Error Message: CS0433: The type 'UPSRateServiceWebReference.RateService' exists in both 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d6545937\de1fce5a\App_WebReferences.ixuylfle.dll' and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d6545937\de1fce5a\assembly\dl3\31691e67\292073b8_400ccd01\App_WebReferences.DLL'

Source Error:


Line 255:
Line 256:        #region PrivateMethods
Line 257:        private RateRequest CreateRateRequest(RateService rate)
Line 258:        {
Line 259:            RateRequest rateRequest = new RateRequest();

最佳答案

在 Visual Studio 2013 中,您应该选中“Precompile During Publishing”选项,我这样做并解决了这个问题。

enter image description here

在您的情况下,您可以尝试选中“允许更新此预编译站点”

关于c# - 如何发布我的网站?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9892646/

相关文章:

c# - c# wpf 列表框的加载屏幕

c# - WPF 列表框在 SelectedItem 之后显示下一个元素

asp.net - LINQ:多对多关系,从列表中选择

jquery - 保存 html 的最佳实践决策?

vb.net 获取事件 excel 工作簿的完整路径和文件名

c# - 将 native C++ 移植到 .NET

c# - 为什么在写入 StreamWriter 时会得到 System.Collections.Generic.Dictionary`2?

c# - .NET 4 垃圾收集器的可扩展性

javascript - 将数字(前面不带字符)替换为 _(下划线)

sql - 为什么允许我有两个同名索引?