Click here to Skip to main content
15,881,840 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Main differences between .Net 1.1 and 2.0 Pin
munklefish20-Jul-06 22:39
munklefish20-Jul-06 22:39 
AnswerRe: Main differences between .Net 1.1 and 2.0 Pin
Paddy Boyd20-Jul-06 22:01
Paddy Boyd20-Jul-06 22:01 
GeneralRe: Main differences between .Net 1.1 and 2.0 Pin
munklefish20-Jul-06 22:38
munklefish20-Jul-06 22:38 
QuestionMulti-purpose DAL using Typed DataSets (PostGres AND MS SQL) Pin
zrrbite20-Jul-06 12:23
zrrbite20-Jul-06 12:23 
AnswerRe: Multi-purpose DAL using Typed DataSets (PostGres AND MS SQL) Pin
Not Active20-Jul-06 14:34
mentorNot Active20-Jul-06 14:34 
QuestionProblem with DataTable Updating Pin
mahesh kukkadapu20-Jul-06 11:31
mahesh kukkadapu20-Jul-06 11:31 
QuestionTreeview size changes after postback!? Pin
WebMaster20-Jul-06 10:52
WebMaster20-Jul-06 10:52 
AnswerRe: Treeview size changes after postback!? Pin
minhpc_bk20-Jul-06 16:28
minhpc_bk20-Jul-06 16:28 
QuestionHelp~!! Pin
maddict20-Jul-06 8:12
maddict20-Jul-06 8:12 
QuestionBeautiful Page Pin
TheEagle20-Jul-06 4:33
TheEagle20-Jul-06 4:33 
AnswerRe: Beautiful Page Pin
bluewavestrider20-Jul-06 5:02
bluewavestrider20-Jul-06 5:02 
GeneralRe: Beautiful Page Pin
TheEagle24-Jul-06 18:38
TheEagle24-Jul-06 18:38 
AnswerRe: Beautiful Page Pin
Not Active20-Jul-06 5:03
mentorNot Active20-Jul-06 5:03 
GeneralRe: Beautiful Page Pin
TheEagle24-Jul-06 18:41
TheEagle24-Jul-06 18:41 
AnswerRe: Beautiful Page Pin
Paddy Boyd20-Jul-06 6:21
Paddy Boyd20-Jul-06 6:21 
GeneralRe: Beautiful Page Pin
TheEagle24-Jul-06 18:47
TheEagle24-Jul-06 18:47 
AnswerRe: Beautiful Page Pin
WillemM20-Jul-06 22:47
WillemM20-Jul-06 22:47 
GeneralRe: Beautiful Page Pin
TheEagle24-Jul-06 18:31
TheEagle24-Jul-06 18:31 
QuestionTimed Executions for Application Pin
RedGoblin20-Jul-06 4:11
RedGoblin20-Jul-06 4:11 
AnswerRe: Timed Executions for Application Pin
Paddy Boyd20-Jul-06 4:54
Paddy Boyd20-Jul-06 4:54 
GeneralRe: Timed Executions for Application Pin
RedGoblin20-Jul-06 5:05
RedGoblin20-Jul-06 5:05 
QuestionCaching interop calls - not good [modified] Pin
Malcolm Smart20-Jul-06 3:01
Malcolm Smart20-Jul-06 3:01 
AnswerRe: Caching interop calls - not good Pin
Malcolm Smart20-Jul-06 4:47
Malcolm Smart20-Jul-06 4:47 
GeneralRe: Caching interop calls - not good Pin
Dustin Metzgar20-Jul-06 6:26
Dustin Metzgar20-Jul-06 6:26 
GeneralRe: Caching interop calls - not good [modified] Pin
Malcolm Smart20-Jul-06 22:44
Malcolm Smart20-Jul-06 22:44 
Getting there I think....but I can't seem to load anything using this method. Code included below...

<br />
public class MonkeyDLL : MarshalByRefObject<br />
{<br />
    public string LoadBatch(string batchName)<br />
    {<br />
        long i = 0;<br />
        <br />
        GetBatchJobSize(batchName, ref i);<br />
<br />
        System.Text.StringBuilder buf1 = new System.Text.StringBuilder(((int)(i + 10)));<br />
        GetBatchJob(batchName, buf1);<br />
<br />
        return buf1.ToString();<br />
    }<br />
<br />
    [System.Runtime.InteropServices.DllImport("d:/data/inetpub/focs/bin/MonkeyCfg.dll")]<br />
    public static extern long GetBatchJobSize(string str, ref long i);<br />
<br />
    [System.Runtime.InteropServices.DllImport("d:/data/inetpub/focs/bin/MonkeyCfg.dll")]<br />
    public static extern void GetBatchJob(string str, System.Text.StringBuilder buf);<br />
<br />
};<br />
<br />
<br />
//calling code<br />
<br />
 MonkeyDLL monkey = new MonkeyDLL();<br />
            AppDomain ad = AppDomain.CreateDomain("MonkeyDomain");<br />
<br />
            MonkeyDLL remoteWorker = (MonkeyDLL)ad.CreateInstanceAndUnwrap(<br />
          "d:/data/inetpub/focs/bin/MonkeyCfg.dll",<br />
          "Worker");  <--FAILS HERE<br />
            <br />
            //parse the batch string<br />
            cached_batch batch = new cached_batch();<br />
            batch.BatchName = job;<br />
            batch.XMLContent = remoteWorker.LoadBatch(job); ;//batchString;<br />
<br />
AppDomain.Unload(ad);<br />

? - What is the second param in CreateInstanceAndUnwrap for? My DLL contains only two methods listed earlier in the thread.


Fails with
System.IO.FileLoadException: COuld not load file or assembly 'd:/data/inetpub/focs/bin/MonkeyCfg.dll' or one of its dependencies. 
 The given assembly name or codebase was invalid.


The DLL calls works fine through 'normal' interop, so the path is correct, the dependencies are there. I attempted to switch the assembly in CreateInstanceAndUnwrap with notepad, ir c:/winnt/system32/notepad.exe and got the same error.

Can you hammer home what mundane stupid thing I have missed please, or am I missing the whole plot?!?

Cheers

Regards

Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.


-- modified at 5:17 Friday 21st July, 2006

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.