Results 1 to 7 of 7

Thread: [RESOLVED] Application Domain question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Resolved [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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    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

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: Application Domain question

    Hello,

    Error was posted (see first post). It was a file not found exception.

    Thanks,

    Strick

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width