Click here to Skip to main content
15,926,703 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: loading text from a file... Pin
Christian Graus26-Jan-07 10:07
protectorChristian Graus26-Jan-07 10:07 
AnswerRe: loading text from a file... Pin
gladsmhe26-Jan-07 11:04
gladsmhe26-Jan-07 11:04 
AnswerRe: loading text from a file... Pin
Geoff_300127-Jan-07 1:10
Geoff_300127-Jan-07 1:10 
GeneralRe: loading text from a file... Pin
Sergi2528-Jan-07 12:09
Sergi2528-Jan-07 12:09 
QuestionDisplay an Image Pin
Central_IT26-Jan-07 4:07
Central_IT26-Jan-07 4:07 
AnswerRe: Display an Image Pin
Christian Graus26-Jan-07 10:06
protectorChristian Graus26-Jan-07 10:06 
GeneralRe: Display an Image Pin
Central_IT29-Jan-07 22:51
Central_IT29-Jan-07 22:51 
QuestionProblem unloading AppDomain Pin
dlarkin7726-Jan-07 1:19
dlarkin7726-Jan-07 1:19 
Hi,

I'm writing a small app that will retrieve the assembly version number of all assemblies in a particular folder.

To do this I'm loading each assembly into its own app domain, getting the info I need and then unloading the app domain. But this still leaves the assemblies locked - they are only unlocked when I exit the application. How can I get around this?

To be able to load each assembly in its own app domain my own application has to be running from the same location as the assembly. Is there any way around this?

The code I use is below:
<code>
Private Sub ListProjects(ByVal root As String)

Dim baseDirectory As New DirectoryInfo(root)
Dim assemblies As FileInfo() = baseDirectory.GetFiles("*.dll")

For Each fi As FileInfo In assemblies
Dim fileVersion As String = String.Empty
Dim assemblyVersion As String = String.Empty
Dim name As String = fi.Name
Dim path As String = fi.FullName
Dim appDomainName As String = name.Substring(0, name.LastIndexOf("."c))
If name.ToLower.EndsWith("vshost.exe") Then Continue For

Dim ad As System.AppDomain
Dim assem As System.Reflection.Assembly
ad = System.AppDomain.CreateDomain(appDomainName)
assem = ad.Load(System.Reflection.AssemblyName.GetAssemblyName(path))
fileVersion = GetFileVersion(assem)
assemblyVersion = GetAssemblyVersion(assem)

Debug.Print("App Domain = " & ad.FriendlyName)
Debug.Print("Assembly name = " & name
Debug.Print("File Version = " & fileVersion
Debug.Print("Assembly Version = " & assemblyVersion
Debug.Print("==========================================")

AppDomain.Unload(ad)
Next

End Sub
</code>

Thanks,

dlarkin77
Questionbutton Pin
rraajjuu26-Jan-07 0:48
rraajjuu26-Jan-07 0:48 
AnswerRe: button Pin
Christian Graus26-Jan-07 10:06
protectorChristian Graus26-Jan-07 10:06 
Questionsending sms Pin
gladsmhe25-Jan-07 23:32
gladsmhe25-Jan-07 23:32 
AnswerRe: sending sms Pin
andyharman26-Jan-07 10:28
professionalandyharman26-Jan-07 10:28 
QuestionHow to play MP3 file Pin
IqbalVB25-Jan-07 19:40
IqbalVB25-Jan-07 19:40 
AnswerRe: How to play MP3 file Pin
Christian Graus25-Jan-07 22:49
protectorChristian Graus25-Jan-07 22:49 
QuestionWhat's the sqlce connection string in vb.net?? Pin
crazyteh25-Jan-07 19:39
crazyteh25-Jan-07 19:39 
QuestionPrinting many crystal reports in PDF format on one aspx page to Printer directly Pin
Durgamalli25-Jan-07 17:20
Durgamalli25-Jan-07 17:20 
Questionconn or connection setting Pin
sdkgolf25-Jan-07 17:11
sdkgolf25-Jan-07 17:11 
QuestionSimple Override Issue --- Need Help Pin
GWbasicProgrammer25-Jan-07 11:41
GWbasicProgrammer25-Jan-07 11:41 
AnswerRe: Simple Override Issue --- Need Help Pin
Dave Kreskowiak26-Jan-07 11:01
mveDave Kreskowiak26-Jan-07 11:01 
GeneralRe: Simple Override Issue --- Need Help Pin
GWbasicProgrammer29-Jan-07 7:53
GWbasicProgrammer29-Jan-07 7:53 
QuestionAm I missing something? Pin
KreativeKai25-Jan-07 8:11
professionalKreativeKai25-Jan-07 8:11 
AnswerRe: Am I missing something? Pin
Kschuler25-Jan-07 8:14
Kschuler25-Jan-07 8:14 
Questioncreate timer in class Pin
Marc Soleda25-Jan-07 6:51
Marc Soleda25-Jan-07 6:51 
AnswerRe: create timer in class Pin
MatrixCoder25-Jan-07 7:46
MatrixCoder25-Jan-07 7:46 
AnswerRe: create timer in class Pin
TwoFaced25-Jan-07 7:52
TwoFaced25-Jan-07 7:52 

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.