Click here to Skip to main content
16,007,610 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: TabStop for Listbox Pin
Wendelius18-Jan-09 0:28
mentorWendelius18-Jan-09 0:28 
GeneralRe: TabStop for Listbox Pin
bobbymale7719-Jan-09 0:50
bobbymale7719-Jan-09 0:50 
QuestionClickOnce rant Pin
RugbyLeague16-Jan-09 3:50
RugbyLeague16-Jan-09 3:50 
AnswerRe: ClickOnce rant Pin
Eddy Vluggen18-Jan-09 0:44
professionalEddy Vluggen18-Jan-09 0:44 
Questionload type using config file. Pin
Sendilkumar.M16-Jan-09 1:32
Sendilkumar.M16-Jan-09 1:32 
AnswerRe: load type using config file. Pin
Pete O'Hanlon16-Jan-09 2:07
mvePete O'Hanlon16-Jan-09 2:07 
AnswerRe: load type using config file. Pin
Henry Minute16-Jan-09 4:22
Henry Minute16-Jan-09 4:22 
Question.Net Object dispose and dll file locked problem Pin
Michael Yip15-Jan-09 22:26
Michael Yip15-Jan-09 22:26 
Dear all :

I create a simple code (window application) like following
Private Sub Button1_Click()
Dim Obj As Object
Dim asm As Assembly = Assembly.LoadFrom("TestApp.dll")
Dim ty As Type = asm.GetType("TestApp.appServ")
Obj = Activator.CreateInstance(ty)
Dim Istring As String = Obj.funct()
MessageBox.Show(Istring)
Obj.Dispose()
GC.SuppressFinalize(Obj)

Obj = Nothing
end sub

while TestApp.dll code follow that
using System;
using System.Collections.Generic;
using System.Text;

namespace TestApp
{
public class appServ : IDisposable
{
private bool disposed = false;
public string funct()
{
return "aad";
}
~appServ()
{

// call Dispose with false. Since we're in the
// destructor call, the managed resources will be
// disposed of anyways.
Dispose(false);
}

protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
// dispose-only, i.e. non-finalizable logic
}

// shared cleanup logic
disposed = true;
}
}



public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
GC.Collect();
}

}
}



Before the button click the "TestApp.dll" allow be overwrite
but after button click , the file is locked until the main program exit.
Can anyone tell me how to solve it ?

Thanks

Michael Laugh | :laugh:
AnswerRe: .Net Object dispose and dll file locked problem Pin
Dave Kreskowiak16-Jan-09 0:58
mveDave Kreskowiak16-Jan-09 0:58 
AnswerRe: .Net Object dispose and dll file locked problem Pin
Pete O'Hanlon16-Jan-09 1:19
mvePete O'Hanlon16-Jan-09 1:19 
GeneralRe: .Net Object dispose and dll file locked problem Pin
Michael Yip16-Jan-09 4:42
Michael Yip16-Jan-09 4:42 
GeneralRe: .Net Object dispose and dll file locked problem Pin
Jon Rista16-Jan-09 5:46
Jon Rista16-Jan-09 5:46 
AnswerRe: .Net Object dispose and dll file locked problem Pin
Eddy Vluggen18-Jan-09 0:49
professionalEddy Vluggen18-Jan-09 0:49 
QuestionBCP in Windows Schedular Pin
indian14315-Jan-09 20:56
indian14315-Jan-09 20:56 
AnswerRe: BCP in Windows Schedular Pin
Dave Kreskowiak16-Jan-09 0:56
mveDave Kreskowiak16-Jan-09 0:56 
GeneralRe: BCP in Windows Schedular Pin
indian14316-Jan-09 3:16
indian14316-Jan-09 3:16 
GeneralRe: BCP in Windows Schedular Pin
Dave Kreskowiak16-Jan-09 3:42
mveDave Kreskowiak16-Jan-09 3:42 
AnswerRe: BCP in Windows Schedular Pin
Wendelius17-Jan-09 5:47
mentorWendelius17-Jan-09 5:47 
Questionvb.net with excel2007 Pin
jetgrageda15-Jan-09 20:31
jetgrageda15-Jan-09 20:31 
AnswerRe: vb.net with excel2007 Pin
Eddy Vluggen18-Jan-09 1:09
professionalEddy Vluggen18-Jan-09 1:09 
QuestionHow can a remoted .NET object access objects/methods in the hosting app? Pin
Dathom15-Jan-09 10:04
Dathom15-Jan-09 10:04 
AnswerRe: How can a remoted .NET object access objects/methods in the hosting app? Pin
Moim Hossain16-Jan-09 10:15
Moim Hossain16-Jan-09 10:15 
RantCannot access a disposed object: Object name: ‘System.Net.Sockets.NetworkStream’. Pin
Brady Kelly15-Jan-09 5:30
Brady Kelly15-Jan-09 5:30 
GeneralRe: Cannot access a disposed object: Object name: ‘System.Net.Sockets.NetworkStream’. Pin
Luc Pattyn15-Jan-09 5:49
sitebuilderLuc Pattyn15-Jan-09 5:49 
GeneralRe: Cannot access a disposed object: Object name: ‘System.Net.Sockets.NetworkStream’. Pin
Brady Kelly15-Jan-09 5:54
Brady Kelly15-Jan-09 5:54 

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.