Click here to Skip to main content
15,923,006 members
Home / Discussions / C#
   

C#

 
Questiondatetime format in c# and asp.net Pin
deepak130-Mar-06 14:12
deepak130-Mar-06 14:12 
AnswerRe: datetime format in c# and asp.net Pin
Guffa30-Mar-06 14:30
Guffa30-Mar-06 14:30 
AnswerRe: datetime format in c# and asp.net Pin
V.30-Mar-06 20:17
professionalV.30-Mar-06 20:17 
Questionhow to enable doublebuffering in drawing shapes ? Pin
hdv21230-Mar-06 12:14
hdv21230-Mar-06 12:14 
AnswerRe: how to enable doublebuffering in drawing shapes ? Pin
leppie30-Mar-06 19:16
leppie30-Mar-06 19:16 
QuestionGet local time of a remote PC Pin
bizdales30-Mar-06 11:55
bizdales30-Mar-06 11:55 
AnswerRe: Get local time of a remote PC Pin
Joshua Quick30-Mar-06 14:30
Joshua Quick30-Mar-06 14:30 
QuestionRe: Get local time of a remote PC Pin
bizdales31-Mar-06 6:04
bizdales31-Mar-06 6:04 
AnswerRe: Get local time of a remote PC Pin
Joshua Quick31-Mar-06 9:24
Joshua Quick31-Mar-06 9:24 
AnswerRe: Get local time of a remote PC Pin
Joshua Quick31-Mar-06 9:29
Joshua Quick31-Mar-06 9:29 
Questionhow to print a text? Pin
abdelhameed8130-Mar-06 11:28
abdelhameed8130-Mar-06 11:28 
AnswerRe: how to print a text? Pin
Ravi Bhavnani30-Mar-06 12:53
professionalRavi Bhavnani30-Mar-06 12:53 
QuestionApp.config in Class Library Pin
Stefano Alini30-Mar-06 10:42
Stefano Alini30-Mar-06 10:42 
AnswerRe: App.config in Class Library Pin
LongRange.Shooter30-Mar-06 15:08
LongRange.Shooter30-Mar-06 15:08 
Questionapp.config Pin
i_martin_r30-Mar-06 10:08
i_martin_r30-Mar-06 10:08 
AnswerRe: app.config Pin
darkelv30-Mar-06 16:04
darkelv30-Mar-06 16:04 
GeneralRe: app.config Pin
AB777130-Mar-06 17:05
AB777130-Mar-06 17:05 
GeneralRe: app.config Pin
darkelv30-Mar-06 19:47
darkelv30-Mar-06 19:47 
GeneralRe: app.config Pin
AB777130-Mar-06 21:57
AB777130-Mar-06 21:57 
GeneralRe: app.config Pin
darkelv30-Mar-06 23:05
darkelv30-Mar-06 23:05 
GeneralRe: app.config Pin
i_martin_r30-Mar-06 22:54
i_martin_r30-Mar-06 22:54 
QuestionI can't modify a dll even though its AppDomain has been unloaded Pin
kayhustle30-Mar-06 9:42
kayhustle30-Mar-06 9:42 
I needed to access an assembly, which I did by loading it into another AppDomain.
Next, I unload the AppDomain. Now when I try to open up that dll for writing it tells me that the file is being used by another process. I thought that the file got unloaded once the AppDomain was unloaded. That is the only reason I loaded the dll into another AppDomain, so that I could unload it and allow it to be overwritten afterward.

Here is my code. The dll is in the directory that the main executable is running in. This is the only way I got the domain to load the assembly. Once the domain loads the assembly a FileStream cannot be opened for writing on that file. It makes no sense because I unload the domain Unsure | :~ :

AppDomainSetup aps = new AppDomainSetup();<br />
           <br />
            aps.ApplicationBase=@"myapplocation";<br />
              AppDomain domain = AppDomain.CreateDomain("My New Domain",null,aps);<br />
            string apploc = @"myexecuting assembly location";<br />
            domain.ExecuteAssembly(apploc);<br />
           <br />
            Assembly ass = domain.Load("AdCenter");<br />
           <br />
            AppDomain.Unload(domain);<br />
           <br />
//The following call throws an exception saying that the file is in use by another process<br />
           FileStream fs = new FileStream("AdCenter.dll", FileMode.Open, FileAccess.ReadWrite);


Thanks

-- modified at 15:59 Thursday 30th March, 2006
AnswerRe: I can't modify a dll even though its AppDomain has been unloaded Pin
Ed.Poore30-Mar-06 11:09
Ed.Poore30-Mar-06 11:09 
AnswerRe: I can't modify a dll even though its AppDomain has been unloaded Pin
leppie30-Mar-06 19:12
leppie30-Mar-06 19:12 
AnswerRe: I can't modify a dll even though its AppDomain has been unloaded Pin
Daniel Grunwald31-Mar-06 1:25
Daniel Grunwald31-Mar-06 1:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.