Compiling ASP.Net app fails to replace DLL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Every time I build, I have to delete the DLL from the bin directory or the debugger will run the old DLL file. (actually, happens on release versions too). I asked about this earlier, too. Thoughts
 
one thought, this may be a permissions issue:

make sure you have delete (read/write) permissions on the directory AND to
the temporary internet iis folders which hold these references.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Every time I build, I have to delete the DLL from the bin directory or the
debugger will run the old DLL file. (actually, happens on release versions
too). I asked about this earlier, too. Thoughts?
 
Hi,


Thanks for posting in the community!
From your description, you found that the assembly of a certain web
application can't be replaced with new one when build the web application
in VS.NET. And you need to manually remove the dll file in the bin
directory folder,yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, I agree with Alvin that this problem is likely to
be a permission issue, would you please have a try and confirm the
following items:
1. Have you tried creating a simple winform application to see whether the
problem exists so that we can confirm whether the problem is concerned to
IIS or not?

2. Try creating a new web application, first make it with a simple page and
build it to see whether the problem remains? If not, then try add some
similiar code or reference to what in the former application which suffer
this problem, then build it to see whether the problem remains.

3. Is there anyother things may refer the dll when building the applicaion
so that it can't be overwrited? Or there anything particular in the web
application's code or some certain external components it has refered?

Please check out the preceding items. If you have any questions or if you
got any new findings, please feel free to post here.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Thanks for replying, Alvin. I do have admin rights on the server, and that role seems to have full permissions on the folders in question.

----- Alvin Bruney [MVP] wrote: -----

one thought, this may be a permissions issue:

make sure you have delete (read/write) permissions on the directory AND to
the temporary internet iis folders which hold these references.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Every time I build, I have to delete the DLL from the bin directory or the
debugger will run the old DLL file. (actually, happens on release versions
too). I asked about this earlier, too. Thoughts?
 
Hi, Steven. Thanks for responding.

1. Winform apps seem to work fine. Also, if I change the ASPX file, it replaces the DLL, it only fails if I edit CS files only.

2. That will take me a while. I'll give it a try and let everyone know.

3. I did just recently turn off the Index Server because of the References problem that it causes - maybe that will improve the situation.

S
----- Steven Cheng[MSFT] wrote: -----

Hi,


Thanks for posting in the community!
From your description, you found that the assembly of a certain web
application can't be replaced with new one when build the web application
in VS.NET. And you need to manually remove the dll file in the bin
directory folder,yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, I agree with Alvin that this problem is likely to
be a permission issue, would you please have a try and confirm the
following items:
1. Have you tried creating a simple winform application to see whether the
problem exists so that we can confirm whether the problem is concerned to
IIS or not?

2. Try creating a new web application, first make it with a simple page and
build it to see whether the problem remains? If not, then try add some
similiar code or reference to what in the former application which suffer
this problem, then build it to see whether the problem remains.

3. Is there anyother things may refer the dll when building the applicaion
so that it can't be overwrited? Or there anything particular in the web
application's code or some certain external components it has refered?

Please check out the preceding items. If you have any questions or if you
got any new findings, please feel free to post here.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Hi,


Thanks for your prompt response. Now we could focus this problem on web
application issue. As you mentioned that the problem only occur when you
edit the codebehind file rather than aspx. I think this is normal since the
assembly file in "bin" directory only contains the codebehind page classes
and the global class, and the runtime page class (generated from the aspx
and code behind is compiled at runtime) so modification on aspx file won't
cause the assembly in "bin" folder to change. In addtion, as you mentioned
the Index Server, you're using index service, aren't you? Do you think this
may be also a potential clue? I still feel that the issue is likely caused
by other programs or process which is also using or refering the assemly
when build the project. Anyway, if you got any progress on this, please
feel free to post here.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Hi,


Regarding on this issue, have you got any progress or have you resolved the
problem? If you need any assistance, please feel free to let me know.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
The problem only occurs when I edit the CS file. When I edit the HTML file (the ASPX file) the DLL compiles OK

Smaller projects do not have this problem. I have several other projects that compile just fine.

I removed the refernces one by one and tried to compile and no one of them seems to be causing the problem. Of course, if I were to remove ALL the references, most otf the project would have to be excluded in order to compile at all. Not much of a test there

I have turned off Index Server on the development server, and while that did solve a permissions problem I was having, it did not solve this problem

If it is a permissions problem is there some logging I can turn on in order to get an error message



----- Steven Cheng[MSFT] wrote: ----

Hi


Thanks for your prompt response. Now we could focus this problem on web
application issue. As you mentioned that the problem only occur when you
edit the codebehind file rather than aspx. I think this is normal since the
assembly file in "bin" directory only contains the codebehind page classes
and the global class, and the runtime page class (generated from the aspx
and code behind is compiled at runtime) so modification on aspx file won't
cause the assembly in "bin" folder to change. In addtion, as you mentioned
the Index Server, you're using index service, aren't you? Do you think this
may be also a potential clue? I still feel that the issue is likely caused
by other programs or process which is also using or refering the assemly
when build the project. Anyway, if you got any progress on this, please
feel free to post here



Regards

Steven Chen
Microsoft Online Suppor

Get Secure! www.microsoft.com/securit
(This posting is provided "AS IS", with no warranties, and confers no
rights.
 
Hi,


Thanks for your followup. Since you mentioned that the dll can't been
replace problem still remains, is there any detailed error info on it
except genral file curruption error? Also, does the project's dll or itself
been referenced by other project? I doubt whether it is caused by the
project's dll is referenced by other projects as "copy local" as false so
..?
In addition, I think you may try using the "FileMon" to have a monitor when
the project is rebuilded to see whether the project's dll is referenced by
some other projects or some application else?


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
No error message is given at all. In fact, I don't even get a file corruption messsge. It is if ASP.NET doesn't even know that the DLL is the wrong version. It goes so fas as to show up when debugging. I can tell when the DLL hasn't compiled because if I set a breakpoint on a changed line of code, the red highlighting may be too long or too short t match the length of the code that used to be there. I can send a screenshot of this if you wish

The project DLL is not being cross-refernced, though this is a good thought. I'll check FileMon today to see if the DLL is being used by anyone - that's a good idea. Is there any advanced build logging I can turn on that I don't know about



----- Steven Cheng[MSFT] wrote: ----

Hi


Thanks for your followup. Since you mentioned that the dll can't been
replace problem still remains, is there any detailed error info on it
except genral file curruption error? Also, does the project's dll or itself
been referenced by other project? I doubt whether it is caused by the
project's dll is referenced by other projects as "copy local" as false so
..
In addition, I think you may try using the "FileMon" to have a monitor when
the project is rebuilded to see whether the project's dll is referenced by
some other projects or some application else


Regards

Steven Chen
Microsoft Online Suppor

Get Secure! www.microsoft.com/securit
(This posting is provided "AS IS", with no warranties, and confers no
rights.
 
Hi,


In addition to filemon, I think you may have a try on the
"System.IO.FileSystemWater" class which can be used to monitor a certain
file in the system. You can launch a certain instance of this class in a
console or windorm application and monitor the dll file you want. That may
be more clear than the Filemon. For detailed info on the FileSystemWater
class you my view the following reference in MSDN:

#Reacting to File System Events
http://msdn.microsoft.com/library/en-us/vbcon/html/vborireactingtofilesystem
events.asp?frame=true

#Creating Handlers for File System Events
http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskcreatinghandlersforf
ilesystemevents.asp?frame=true

Hope this helps.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Fantastic, I;ll give that a try here shortly. Thanks.

S

(e-mail address removed) (Steven Cheng[MSFT]) wrote in
Hi,


In addition to filemon, I think you may have a try on the
"System.IO.FileSystemWater" class which can be used to monitor a
certain file in the system. You can launch a certain instance of this
class in a console or windorm application and monitor the dll file you
want. That may be more clear than the Filemon. For detailed info on
the FileSystemWater class you my view the following reference in MSDN:
[...]
 
Back
Top