ASP.Net Web 应用程序部署 -

发布于 2024-12-12 19:32:12 字数 830 浏览 2 评论 0原文

我正在尝试在 VS 2010 中部署/发布我的 ASP.NET WebForms 应用程序,但我遇到了麻烦。

在构建设置“要部署的项目”部分,我选择: “仅运行此应用程序所需的文件”,因为我不希望其他人访问 .cs/designer.cs 文件和其他代码数据。

一切似乎都完美无缺,但是当尝试使用浏览器加载默认页面时,我收到以下错误:

Parser Error

Description: An error occurred during the parsing of a resource required to service            
this request. Please review the following specific parse error details and modify your  
source file appropriately. 

Parser Error Message: The file '/MyWebApp/Default.aspx.cs' does not exist.

当我查看部署的文件夹时,我显然看不到上面提到的 .cs 文件,但根据我的理解,我无论如何都不应该看到它,因为文件背后的所有代码都被编译到位于部署文件夹的 bin 文件夹中的 MyWebApp.dll 中。

最后值得一提的是,我

<validation validateIntegratedModeConfiguration="false" />

在 web.config 中添加了:来修复我之前遇到的另一个错误。

不确定这是否与之前的错误有关,但我认为值得一提。

我缺少什么?

I'm trying to deploy/publish my ASP.NET WebForms application in VS 2010 but i'm having trouble doing so.

On the build settings "Items to deploy" section I choose:
"Only files needed to run this application" since I don't want others to access the .cs/designer.cs files and other code data.

Everything works flawlessly it seems, but when trying to load up the default page with my browser I get the following error:

Parser Error

Description: An error occurred during the parsing of a resource required to service            
this request. Please review the following specific parse error details and modify your  
source file appropriately. 

Parser Error Message: The file '/MyWebApp/Default.aspx.cs' does not exist.

When I look in the deployed folder I obviously can't see the .cs file mentioned above, but from my understanding, I shouldn't see it anyways, since all code behind files are compiled into MyWebApp.dll which is located in deployed folder's bin folder.

Last thing worth mentioning is that I've added:

<validation validateIntegratedModeConfiguration="false" />

in my web.config to fix a different error I got earlier.

Not sure that this has to do with the previous error, but I thought it's worth mentioning.

What am I missing?

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

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

发布评论

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

评论(1

标点 2024-12-19 19:32:12

听起来它仍然是一个网站,而不是一个网络应用程序。有关网站和 Web 应用程序之间差异的信息,请参阅以下文档:

Web 应用程序项目与网站项目

以及有关如何将网站转换为 Web 应用程序的文档:

演练:在 Visual Studio 中将网站项目转换为 Web 应用程序项目

It sounds like it is still a web site and not a web application. Please see the following documentation for information on differences between a web site and web application:

Web Application Projects versus Web Site Projects

and this documentation for how to convert your web site to a web application:

Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio

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