Click here to Skip to main content
16,003,345 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: MarshallByRef problem Pin
Dave Kreskowiak27-Nov-07 5:15
mveDave Kreskowiak27-Nov-07 5:15 
GeneralRe: MarshallByRef problem Pin
cstrader23227-Nov-07 5:39
cstrader23227-Nov-07 5:39 
GeneralRe: MarshallByRef problem Pin
Dave Kreskowiak27-Nov-07 6:25
mveDave Kreskowiak27-Nov-07 6:25 
GeneralRe: MarshallByRef problem Pin
cstrader23227-Nov-07 7:07
cstrader23227-Nov-07 7:07 
GeneralRe: MarshallByRef problem Pin
Dave Kreskowiak27-Nov-07 7:48
mveDave Kreskowiak27-Nov-07 7:48 
Questionhow to know which procces['s] have access to a file Pin
combo_ci27-Nov-07 3:46
combo_ci27-Nov-07 3:46 
AnswerRe: how to know which procces['s] have access to a file Pin
Dave Kreskowiak27-Nov-07 5:43
mveDave Kreskowiak27-Nov-07 5:43 
Questionvb.net versus c# problem Pin
cstrader23227-Nov-07 3:36
cstrader23227-Nov-07 3:36 
I am trying to load an application into a new domain. I have this c# code that runs fine:

AppDomain newDomain = AppDomain.CreateDomain("newDomain");
FileStream fs = new FileStream("c:\\TestClass.dll", FileMode.Open);
byte[] rawAssembly = new byte[(int)fs.Length];
Console.Write(fs.Length);
fs.Read(rawAssembly, 0, rawAssembly.Length);
Assembly asm = newDomain.Load(rawAssembly, null);

However the translation into vb.net does not:

Dim newDomain As AppDomain = AppDomain.CreateDomain("newDomain")
Dim fs As FileStream = New FileStream("c:\\TestClass.dll", FileMode.Open)
Dim rawAssembly() As Byte = New Byte((CType(fs.Length, Integer)) - 1) {}
fs.Read(rawAssembly, 0, rawAssembly.Length)
Dim asm As Assembly = newDomain.Load(rawAssembly, Nothing)

produces this error on the final line:

Could not load file or assembly 'TestClass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Both versions read the same number of bytes into the filestream.

thanks

AnswerRe: vb.net versus c# problem Pin
Dave Kreskowiak27-Nov-07 5:10
mveDave Kreskowiak27-Nov-07 5:10 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 5:35
cstrader23227-Nov-07 5:35 
GeneralRe: vb.net versus c# problem Pin
Dave Kreskowiak27-Nov-07 6:13
mveDave Kreskowiak27-Nov-07 6:13 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 6:56
cstrader23227-Nov-07 6:56 
GeneralRe: vb.net versus c# problem Pin
Dave Kreskowiak27-Nov-07 8:19
mveDave Kreskowiak27-Nov-07 8:19 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 12:07
cstrader23227-Nov-07 12:07 
GeneralRe: vb.net versus c# problem Pin
Dave Kreskowiak27-Nov-07 14:32
mveDave Kreskowiak27-Nov-07 14:32 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 14:59
cstrader23227-Nov-07 14:59 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 15:01
cstrader23227-Nov-07 15:01 
GeneralRe: vb.net versus c# problem Pin
Dave Kreskowiak27-Nov-07 15:29
mveDave Kreskowiak27-Nov-07 15:29 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 16:58
cstrader23227-Nov-07 16:58 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 17:22
cstrader23227-Nov-07 17:22 
GeneralRe: vb.net versus c# problem Pin
Dave Kreskowiak28-Nov-07 3:29
mveDave Kreskowiak28-Nov-07 3:29 
GeneralRe: vb.net versus c# problem Pin
Luc Pattyn27-Nov-07 15:35
sitebuilderLuc Pattyn27-Nov-07 15:35 
GeneralRe: vb.net versus c# problem Pin
cstrader23227-Nov-07 17:04
cstrader23227-Nov-07 17:04 
QuestionCode error.Please help..What error is this? Pin
kc_renji27-Nov-07 2:27
kc_renji27-Nov-07 2:27 
AnswerRe: Code error.Please help..What error is this? Pin
pmarfleet27-Nov-07 2:31
pmarfleet27-Nov-07 2:31 

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.