Click here to Skip to main content
15,885,925 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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
GeneralRe: Caching interop calls - not good Pin
Malcolm Smart20-Jul-06 23:33
Malcolm Smart20-Jul-06 23:33 
GeneralRe: Caching interop calls - not good Pin
Dustin Metzgar21-Jul-06 3:28
Dustin Metzgar21-Jul-06 3:28 
QuestionHTML Problem Pin
venkatasivaramaprasad20-Jul-06 2:29
venkatasivaramaprasad20-Jul-06 2:29 
AnswerRe: HTML Problem Pin
Malcolm Smart20-Jul-06 3:08
Malcolm Smart20-Jul-06 3:08 
QuestionHey guy , Web.config file Pin
Mohammed Amine20-Jul-06 2:02
Mohammed Amine20-Jul-06 2:02 
AnswerRe: Hey guy , Web.config file Pin
_AK_20-Jul-06 2:14
_AK_20-Jul-06 2:14 
GeneralRe: Hey guy , Web.config file Pin
Mohammed Amine20-Jul-06 2:22
Mohammed Amine20-Jul-06 2:22 
GeneralRe: Hey guy , Web.config file Pin
_AK_20-Jul-06 2:23
_AK_20-Jul-06 2:23 
GeneralRe: Hey guy , Web.config file Pin
Mohammed Amine20-Jul-06 2:43
Mohammed Amine20-Jul-06 2:43 
GeneralRe: Hey guy , Web.config file Pin
_AK_20-Jul-06 2:46
_AK_20-Jul-06 2:46 
GeneralRe: Hey guy , Web.config file Pin
Mohammed Amine20-Jul-06 4:36
Mohammed Amine20-Jul-06 4:36 
GeneralRe: Hey guy , Web.config file Pin
Mohammed Amine20-Jul-06 4:51
Mohammed Amine20-Jul-06 4:51 
GeneralRe: Hey guy , Web.config file Pin
Malcolm Smart20-Jul-06 3:10
Malcolm Smart20-Jul-06 3:10 
GeneralRe: Hey guy , Web.config file Pin
Mohammed Amine20-Jul-06 4:39
Mohammed Amine20-Jul-06 4:39 
GeneralRe: Hey guy , Web.config file Pin
Not Active20-Jul-06 5:08
mentorNot Active20-Jul-06 5:08 
GeneralRe: Hey guy , Web.config file Pin
Mohammed Amine20-Jul-06 5:24
Mohammed Amine20-Jul-06 5:24 
GeneralRe: Hey guy , Web.config file Pin
Not Active20-Jul-06 5:42
mentorNot Active20-Jul-06 5:42 

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.