不允许使用目录/ App_Code,因为应用程序已预编译 [英] The directory /App_Code is not allowed because the application is precompiled

查看:540
本文介绍了不允许使用目录/ App_Code,因为应用程序已预编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS.NET 2005 Beta 2.我有一个帮助我编写的C#类,我在/ app_Code目录中放置了

。一切都在当地运行良好。但是,当我使用复制网络时,我会使用复制网络。将网站上传到生产服务器的功能,我试图在生产页面上运行时出现以下错误:

" System.Web.HttpException:该目录''/ app_Code''不允许

因为应用程序是预编译的。


任何人都知道这在本地工作正常但不在开发中吗?我怎么能解决这个问题?


另外在相关的说明中,我读了很多关于新的\代码的信息。 ASP.NET中的目录

2.0。我是否正确地假设他们在某些时候将它从\ code

更改为\App_Code并且这些是相同的事情?


Steve

解决方案

史蒂夫。


re:

Am我正确地假设他们在某些时候将它从\ code更改为\ App_Code并且
这些是一回事吗?


你说的没错。在Beta 1中,它被称为/ code。

在Beta 2中,它被更改为/ App_Code。


参见 http://msdn.microsoft.com/asp.net/wh...ta2update.aspx

获取特殊目录的完整列表。


re:" System.Web.HttpException:目录''/ App_Code''不是允许,因为
应用程序是预编译的。

任何人都知道这在本地工作正常但不在开发中吗?我该如何解决这个问题?


你不需要解决它。


因为你正在预编译,所以App_Code中会出现的一切$>
目录已经编译好,不需要上传。


如果你想将你的源文件上传到

App_Code目录,不要预编译你的应用程序。


Juan T. Llibre

ASP.NET MVP

ASP.NET常见问题解答: http://asp.net.do/faq/

==========================


"史蒂夫直率" < PL **** @ postreplyhere.com>在消息中写道

新闻:df ******************** @ comcast.com ...我正在使用VS.NET 2005 Beta 2.我有一个帮助我写的C#类,我把它放在我的
/ App_Code目录中。一切都在当地运行良好。但是,当我使用复制Web功能将网站上传到生产服务器时,在尝试运行生产页面时出现以下错误:
系统。 Web.HttpException:目录''/ App_Code''是不允许的,因为
应用程序是预编译的。

任何人都知道这在本地工作正常但不在开发中吗?我怎么解决这个问题?

另外在相关的说明中,我读了很多关于新的\代码的信息。 ASP.NET 2.0中的目录。我是否正确地假设他们在某些时候将其从\ code更改为\ App_Code并且这些
是相同的事情?

史蒂夫



>因为你正在预编译,所以App_Code

目录中的所有内容都已经编译好了,不需要上传。

如果你想上传你的将文件源文件导入到App_Code目录中,不要预编译你的应用程序。




我不是故意预编译我的应用程序。我怎样才能阻止它?
预编译?


本地我只是使用VS.NET 2005 b2进行开发并按F5运行

它。有时我会按F6来检查我是否已经搞砸了任何

代码。


对于生产,我希望灵活性能够编辑

生产服务器上的源代码来动态更新,因此预编译方法

不感兴趣。


我的主要目标是能够轻松地同步我在家里做的工作

在生产服务器上,然后开始工作并轻松更新我的本地

开发Web应用程序副本以反映我在家中通过与生产服务器同步
所做的更改。然后我会在工作中做出改变,当我回到家里时,我会想要将我的家用机器与现在正在生产的产品同步

服务器,等等。目前我正(尝试)使用复制网络功能

。这是否合适和/或是否有更好的方法?


谢谢,


Steve

Juan,


关于我在下面发布的内容的任何想法?期待你的回复。比你好多了。
你这么多。


史蒂夫,


史蒂夫弗兰克斯 < PL **** @ postreplyhere.com>在消息中写道

新闻:H _ ******************** @ comcast.com ...

< blockquote class =post_quotes>因为你正在预编译,所以App_Code
目录中的所有东西都已经编译好了,不需要上传。

如果你想要将源文件上传到
App_Code目录,不要预编译你的应用程序。



我并不是故意预编译我的应用程序。如何防止它进行预编译?

本地我只是使用VS.NET 2005 b2进行开发并按F5来运行它。有时我会按F6来检查我是否已将任何代码搞砸了。

对于生产,我希望能够灵活地编辑
生产服务器即时更新,因此预编译的方法不感兴趣。

我的主要目标是能够轻松地同步我所做的工作。 />在生产服务器上回家,然后开始工作并轻松更新我的网络应用程序的本地开发副本,以反映我在家中通过与生产服务器同步所做的更改。然后我会在工作中做出改变,当我回到家时,我想要将我的家用机器与现在生产服务器上的内容同步,等等。目前我正(尝试)使用
复制Web功能。这是否合适和/或是否有更好的方式?

谢谢,

史蒂夫


I''m using VS.NET 2005 Beta 2. I have a helper C# class I wrote that I placed
in my /App_Code directory. Everything runs fine locally. However when I
use the "Copy Web" function to upload the site to the production server, I
get the following error when trying to run the page on production:
"System.Web.HttpException: The directory ''/App_Code'' is not allowed
because the application is precompiled."

Anyone know this works fine locally but not on development? How can I
resolve this?

Also on a related note I read a lot about a new "\code" directory in ASP.NET
2.0. Am I correct to assume that at some point they changed this from \code
to \App_Code and these are the same thing?

Steve

解决方案

Hi, Steve.

re:

Am I correct to assume that at some point they changed this from \code to \App_Code and
these are the same thing?
You''re correct. In Beta 1 it was called /code.
In Beta 2, it was changed to /App_Code.

See http://msdn.microsoft.com/asp.net/wh...ta2update.aspx
for a complete list of special directories.

re: "System.Web.HttpException: The directory ''/App_Code'' is not allowed because the
application is precompiled."

Anyone know this works fine locally but not on development? How can I resolve this?
You don''t need to resolve it.

Because you''re precompiling, everything that would go in the App_Code
directory is already compiled and doesn''t need to be uploaded.

If you want to upload your source files into the
App_Code directory, don''t precompile your application.


Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"Steve Franks" <pl****@postreplyhere.com> wrote in message
news:df********************@comcast.com... I''m using VS.NET 2005 Beta 2. I have a helper C# class I wrote that I placed in my
/App_Code directory. Everything runs fine locally. However when I use the "Copy Web"
function to upload the site to the production server, I get the following error when
trying to run the page on production:
"System.Web.HttpException: The directory ''/App_Code'' is not allowed because the
application is precompiled."

Anyone know this works fine locally but not on development? How can I resolve this?

Also on a related note I read a lot about a new "\code" directory in ASP.NET 2.0. Am I
correct to assume that at some point they changed this from \code to \App_Code and these
are the same thing?

Steve



> Because you''re precompiling, everything that would go in the App_Code

directory is already compiled and doesn''t need to be uploaded.

If you want to upload your source files into the
App_Code directory, don''t precompile your application.



I am not purposely precompiling my application. How can I prevent it from
precompiling?

Locally I just use VS.NET 2005 b2 to do the development and press F5 to run
it. Sometimes I press F6 to get a sanity check on whether I''ve screwed any
code up.

For production, I want the flexibility to be able to edit source on the
production server to make an update on the fly, so the precompiled approach
is not of interest.

My main goal is to just be able to easily synchronize the work I do at home
on the production server, and then get to work and easily update my local
dev copy of the web app to reflect the changes I''ve made at home by syncing
with the production server. Then I''ll make changes at work, and when I get
home, I''ll want to sync my home machine up with what''s now on the production
server, and so forth. Currently I''m (trying) to use the Copy Web function
for this. Is that appropriate and/or is there a better way?

Thanks,

Steve


Juan,

Any ideas about what I posted below? Looking forward to your response. Than
you so much.

Steve,

"Steve Franks" <pl****@postreplyhere.com> wrote in message
news:H_********************@comcast.com...

Because you''re precompiling, everything that would go in the App_Code
directory is already compiled and doesn''t need to be uploaded.

If you want to upload your source files into the
App_Code directory, don''t precompile your application.



I am not purposely precompiling my application. How can I prevent it from
precompiling?

Locally I just use VS.NET 2005 b2 to do the development and press F5 to
run it. Sometimes I press F6 to get a sanity check on whether I''ve
screwed any code up.

For production, I want the flexibility to be able to edit source on the
production server to make an update on the fly, so the precompiled
approach is not of interest.

My main goal is to just be able to easily synchronize the work I do at
home on the production server, and then get to work and easily update my
local dev copy of the web app to reflect the changes I''ve made at home by
syncing with the production server. Then I''ll make changes at work, and
when I get home, I''ll want to sync my home machine up with what''s now on
the production server, and so forth. Currently I''m (trying) to use the
Copy Web function for this. Is that appropriate and/or is there a better
way?

Thanks,

Steve



这篇关于不允许使用目录/ App_Code,因为应用程序已预编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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