469,086 Members | 1,141 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,086 developers. It's quick & easy.

question about Temporary ASP.NET Files folder

Roy
My dll file is copied to the
"%windir%\Microsoft.NET\Framework\{version}Tempora ry ASP.NET Files" folder
when I compile my asp.net project. When I run the application. The dll under
this folder is loaded, not the one under bin folder. Why is that? How can I
load the one under bin folder?

Nov 18 '05 #1
5 4102
I believe, and hopefully someone will correct me if I'm wrong, the dll's in
your bin folder are those of your .cs/.vb files (codebehind, custom
classes..) as well are resource files and anything else embedded. The .dll
in the temp folder is created dynamically for the aspx files (the ones with
all the html in them). you can't change this behaviour. In 2.0, you'll
have 4 different types of compilation, one of which is what you want.

Karl

"Roy" <Ro*@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
My dll file is copied to the
"%windir%\Microsoft.NET\Framework\{version}Tempora ry ASP.NET Files" folder
when I compile my asp.net project. When I run the application. The dll under this folder is loaded, not the one under bin folder. Why is that? How can I load the one under bin folder?

Nov 18 '05 #2
Hi Roy:

I believe the ASP.NET team was trying to reduce the number of
scenarios where you have to restart the web application.
If ASP.NET loaded the DLL from the bin folder, the DLL would become
locked. The only way to update the DLL would be to stop the web
application to release the lock and then copy in the new DLL.

The way it works now is ASP.NET makes a shadow copy of the DLLs in the
bin directory. If you slide in a new version ASP.NET will detect the
new file, shadow copy and load it up.

HTH,

--
Scott
http://www.OdeToCode.com

On Thu, 19 Aug 2004 06:07:02 -0700, Roy
<Ro*@discussions.microsoft.com> wrote:
My dll file is copied to the
"%windir%\Microsoft.NET\Framework\{version}Tempor ary ASP.NET Files" folder
when I compile my asp.net project. When I run the application. The dll under
this folder is loaded, not the one under bin folder. Why is that? How can I
load the one under bin folder?


Nov 18 '05 #3
Roy
I can understand the reason you gave. But it confuses me more since it
complecates the deployment. I have a subfolder with some resource files under
it. This folder is relative to the bin folder, which means I can get the
folder dynamically from my assembly dll under bin folder. If the dll loaded
is the one under temporary folder, I cannot use XCopy to deploy my project.
How can I resolve it?

"Scott Allen" wrote:
Hi Roy:

I believe the ASP.NET team was trying to reduce the number of
scenarios where you have to restart the web application.
If ASP.NET loaded the DLL from the bin folder, the DLL would become
locked. The only way to update the DLL would be to stop the web
application to release the lock and then copy in the new DLL.

The way it works now is ASP.NET makes a shadow copy of the DLLs in the
bin directory. If you slide in a new version ASP.NET will detect the
new file, shadow copy and load it up.

HTH,

--
Scott
http://www.OdeToCode.com

On Thu, 19 Aug 2004 06:07:02 -0700, Roy
<Ro*@discussions.microsoft.com> wrote:
My dll file is copied to the
"%windir%\Microsoft.NET\Framework\{version}Tempor ary ASP.NET Files" folder
when I compile my asp.net project. When I run the application. The dll under
this folder is loaded, not the one under bin folder. Why is that? How can I
load the one under bin folder?


Nov 18 '05 #4
Hi Roy:

One alternative is to use a 'satellite assembly' instead of a resource
file. Here is some more info:

http://samples.gotdotnet.com/quickst...aspx#satellite

HTH,

--
Scott
http://www.OdeToCode.com
On Thu, 19 Aug 2004 07:55:02 -0700, Roy
<Ro*@discussions.microsoft.com> wrote:
I can understand the reason you gave. But it confuses me more since it
complecates the deployment. I have a subfolder with some resource files under
it. This folder is relative to the bin folder, which means I can get the
folder dynamically from my assembly dll under bin folder. If the dll loaded
is the one under temporary folder, I cannot use XCopy to deploy my project.
How can I resolve it?

"Scott Allen" wrote:
Hi Roy:

I believe the ASP.NET team was trying to reduce the number of
scenarios where you have to restart the web application.
If ASP.NET loaded the DLL from the bin folder, the DLL would become
locked. The only way to update the DLL would be to stop the web
application to release the lock and then copy in the new DLL.

The way it works now is ASP.NET makes a shadow copy of the DLLs in the
bin directory. If you slide in a new version ASP.NET will detect the
new file, shadow copy and load it up.

HTH,

--
Scott
http://www.OdeToCode.com

On Thu, 19 Aug 2004 06:07:02 -0700, Roy
<Ro*@discussions.microsoft.com> wrote:
>My dll file is copied to the
>"%windir%\Microsoft.NET\Framework\{version}Tempor ary ASP.NET Files" folder
>when I compile my asp.net project. When I run the application. The dll under
>this folder is loaded, not the one under bin folder. Why is that? How can I
>load the one under bin folder?



Nov 18 '05 #5
Hi Roy:

Ah! You could just use the MapPath method to get the path to the file.
.. You pass MapPath a virtual path and it will return the physical path
to a file.

If I put:
string s = Server.MapPath("bin/a.bmp");

My result is:

"E:\dev\xprmnt\aspnet\Calendar\bin\a.bmp"
Note: you can also use HttpContext.Current.Server.MapPath if you are
in a class library outside of a web form.

HTH,

--
Scott
http://www.OdeToCode.com

On Thu, 19 Aug 2004 10:35:03 -0700, Roy
<Ro*@discussions.microsoft.com> wrote:
I am sorry I should not use the name "resource files". Actually, they are
picture files such as bmp files. I need to add new files or remove files
frequently. Apparently satellite assembly is not appropriate since it needs
to be compiled. Any other ways to handle this issue?
Thanks.
Roy

"Scott Allen" wrote:


Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Rajiv Das | last post: by
10 posts views Thread by jojobar | last post: by
2 posts views Thread by Chris Newby | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.