[RESOLVED] Application Domain question
Hi all,
Studying for MCPD and working through samples in training kit. I'm on the application domains section. I have the following sample:
Code:
Imports System.Security.Policy
Imports System.Security
Module Module1
Sub Main()
Dim hostEvidence As Object() = {New Zone(SecurityZone.Internet)}
Dim internetEvidence As Evidence = New Evidence(hostEvidence, Nothing)
Dim myDomain As AppDomain = AppDomain.CreateDomain("MyDomain")
myDomain.ExecuteAssembly("SecondAssembly.exe", internetEvidence) 'Exception here
End Sub
End Module
The line where it fails (filenotfound exception) the books says is where I put .exe. I'm not sure what it means since there's no prior step where I placed this .exe here. Am I doing something wrong here?
Thanks,
Strick
Re: Application Domain question
I don't know what your book says but logic would dictate that if you want to execute an assembly then there must be an assembly to execute, so you must specify the path of an existing assembly.
Re: Application Domain question
Hi, thanks for your response.
Found an answer on the net. Program was still crashing even when I physically put in the path to the file.
I found via the net that I needed to create a reference to the .exe file.
Thanks,
Strick
Re: Application Domain question
Might help if you posted WHAT the error is... other wise I'm liable to suggest the problem are the eels...
-tg
Re: Application Domain question
Hello,
Error was posted (see first post). It was a file not found exception.
Thanks,
Strick
Re: Application Domain question
sorry... didn't see that the first time through....
Ok... based on what I'm reading here: http://msdn.microsoft.com/en-us/libr...eassembly.aspx
That version of the overload is obsolete...
that aside though... is something.exe and executable assembly? I don't think it can be just any application, but an actual .NET assembly. AND you aren't pointing to your own app... right? but some other assembly.
-tg
Re: Application Domain question
Hi yeah, that was where I was confused. I tried everything, including pointing to the .exe in my own project which of course didn't work. The book didn't state that I needed to create a reference to a assembly that I created in a previous excercise. So I had no idea that I needed to do this until I began looknig on the net for solutions.
Thanks,
Strick