Home All Groups Group Topic Archive Search About

Assemlby.LoadForm() exception

Author
15 Mar 2006 1:46 PM
Entwickler
I'm trying a very simple test to load an
assembly(dll)  with the Late binding .
Hier is the Code i have in my application :
-----Code ----------
try
            {
                Assembly assemblyInstance =
Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
                                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
-------------code end--------

This is throwing the following exception:
Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll' or one of
its dependencies. The module was expected to contain an assembly manifest.

The DLL i am trying to use is a simple dll that was created with another
tool ( Labwindows CVI from national Instruments).  I muss notify that it
walks , when i try the early Binding with the same DLL .
Can somebody help me ?
Thanks.

Author
15 Mar 2006 1:55 PM
scott blood
This seems to be something to do with Un-Managed code.  Unless you
explicitly specify it, your code will not be able to use umanaged code and
afaik Assembly.LoadFrom requires a managed DLL whether or not you specify
the use of unmanaged code.

Regards
Scott Blood
C# Developer

Show quoteHide quote
"Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
> I'm trying a very simple test to load an
> assembly(dll)  with the Late binding .
> Hier is the Code i have in my application :
> -----Code ----------
> try
>            {
>                Assembly assemblyInstance =
> Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
>                                }
>            }
>            catch (Exception ex)
>            {
>                MessageBox.Show(ex.Message);
>            }
> -------------code end--------
>
> This is throwing the following exception:
> Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll' or one of
> its dependencies. The module was expected to contain an assembly manifest.
>
> The DLL i am trying to use is a simple dll that was created with another
> tool ( Labwindows CVI from national Instruments).  I muss notify that it
> walks , when i try the early Binding with the same DLL .
> Can somebody help me ?
> Thanks.
>
>
Are all your drivers up to date? click for free checkup

Author
15 Mar 2006 2:20 PM
Entwickler
hi scott,
thank you for your answer. but please could you tell me how i can specify
that my dll is an unmanaged code ? i tried to find how to do it without
succes.
Thanks.

Show quoteHide quote
"scott blood" wrote:

> This seems to be something to do with Un-Managed code.  Unless you
> explicitly specify it, your code will not be able to use umanaged code and
> afaik Assembly.LoadFrom requires a managed DLL whether or not you specify
> the use of unmanaged code.
>
> Regards
> Scott Blood
> C# Developer
>
> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
> > I'm trying a very simple test to load an
> > assembly(dll)  with the Late binding .
> > Hier is the Code i have in my application :
> > -----Code ----------
> > try
> >            {
> >                Assembly assemblyInstance =
> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
> >                                }
> >            }
> >            catch (Exception ex)
> >            {
> >                MessageBox.Show(ex.Message);
> >            }
> > -------------code end--------
> >
> > This is throwing the following exception:
> > Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll' or one of
> > its dependencies. The module was expected to contain an assembly manifest.
> >
> > The DLL i am trying to use is a simple dll that was created with another
> > tool ( Labwindows CVI from national Instruments).  I muss notify that it
> > walks , when i try the early Binding with the same DLL .
> > Can somebody help me ?
> > Thanks.
> >
> >
>
>
>
Author
15 Mar 2006 2:28 PM
scott blood
Hello,

Rather than me writing a full paragraph on how to interact with unmanaged
code you can have a look at this article, which pretty much explains
everything.


to specify that your application is allowed to use unmanaged code you
Show quoteHide quote
"Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
news:D94AB040-5D43-49D6-BBBD-29B39B634940@microsoft.com...
> hi scott,
> thank you for your answer. but please could you tell me how i can specify
> that my dll is an unmanaged code ? i tried to find how to do it without
> succes.
> Thanks.
>
> "scott blood" wrote:
>
>> This seems to be something to do with Un-Managed code.  Unless you
>> explicitly specify it, your code will not be able to use umanaged code
>> and
>> afaik Assembly.LoadFrom requires a managed DLL whether or not you specify
>> the use of unmanaged code.
>>
>> Regards
>> Scott Blood
>> C# Developer
>>
>> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
>> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
>> > I'm trying a very simple test to load an
>> > assembly(dll)  with the Late binding .
>> > Hier is the Code i have in my application :
>> > -----Code ----------
>> > try
>> >            {
>> >                Assembly assemblyInstance =
>> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
>> >                                }
>> >            }
>> >            catch (Exception ex)
>> >            {
>> >                MessageBox.Show(ex.Message);
>> >            }
>> > -------------code end--------
>> >
>> > This is throwing the following exception:
>> > Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll' or one
>> > of
>> > its dependencies. The module was expected to contain an assembly
>> > manifest.
>> >
>> > The DLL i am trying to use is a simple dll that was created with
>> > another
>> > tool ( Labwindows CVI from national Instruments).  I muss notify that
>> > it
>> > walks , when i try the early Binding with the same DLL .
>> > Can somebody help me ?
>> > Thanks.
>> >
>> >
>>
>>
>>
Author
15 Mar 2006 2:29 PM
scott blood
Hello

Rather than me writing a full paragraph explaining how to use unmanaged
code, you could have a  look at this article.

http://www.findarticles.com/p/articles/mi_zddvs/is_200502/ai_n9522544

If you are still unsure after reading this , please post back and i will try
and post some easy to understand examples.

Regards
Scott Blood
C# Developer

Show quoteHide quote
"Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
news:D94AB040-5D43-49D6-BBBD-29B39B634940@microsoft.com...
> hi scott,
> thank you for your answer. but please could you tell me how i can specify
> that my dll is an unmanaged code ? i tried to find how to do it without
> succes.
> Thanks.
>
> "scott blood" wrote:
>
>> This seems to be something to do with Un-Managed code.  Unless you
>> explicitly specify it, your code will not be able to use umanaged code
>> and
>> afaik Assembly.LoadFrom requires a managed DLL whether or not you specify
>> the use of unmanaged code.
>>
>> Regards
>> Scott Blood
>> C# Developer
>>
>> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
>> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
>> > I'm trying a very simple test to load an
>> > assembly(dll)  with the Late binding .
>> > Hier is the Code i have in my application :
>> > -----Code ----------
>> > try
>> >            {
>> >                Assembly assemblyInstance =
>> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
>> >                                }
>> >            }
>> >            catch (Exception ex)
>> >            {
>> >                MessageBox.Show(ex.Message);
>> >            }
>> > -------------code end--------
>> >
>> > This is throwing the following exception:
>> > Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll' or one
>> > of
>> > its dependencies. The module was expected to contain an assembly
>> > manifest.
>> >
>> > The DLL i am trying to use is a simple dll that was created with
>> > another
>> > tool ( Labwindows CVI from national Instruments).  I muss notify that
>> > it
>> > walks , when i try the early Binding with the same DLL .
>> > Can somebody help me ?
>> > Thanks.
>> >
>> >
>>
>>
>>
Author
16 Mar 2006 7:59 AM
Entwickler
Hello scott,
Thank you for your answer and for the article, but the problem is still
remaning because the article is talking about how to call Unmanaged Code
using the Early Binding, and i know how it walks .  My problem is now , How
can i  call Unmanaged Code using the Late Binding ???? I hope you can help me
..
Regards
Entwickler.


Show quoteHide quote
"scott blood" wrote:

> Hello
>
> Rather than me writing a full paragraph explaining how to use unmanaged
> code, you could have a  look at this article.
>
> http://www.findarticles.com/p/articles/mi_zddvs/is_200502/ai_n9522544
>
> If you are still unsure after reading this , please post back and i will try
> and post some easy to understand examples.
>
> Regards
> Scott Blood
> C# Developer
>
> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
> news:D94AB040-5D43-49D6-BBBD-29B39B634940@microsoft.com...
> > hi scott,
> > thank you for your answer. but please could you tell me how i can specify
> > that my dll is an unmanaged code ? i tried to find how to do it without
> > succes.
> > Thanks.
> >
> > "scott blood" wrote:
> >
> >> This seems to be something to do with Un-Managed code.  Unless you
> >> explicitly specify it, your code will not be able to use umanaged code
> >> and
> >> afaik Assembly.LoadFrom requires a managed DLL whether or not you specify
> >> the use of unmanaged code.
> >>
> >> Regards
> >> Scott Blood
> >> C# Developer
> >>
> >> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
> >> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
> >> > I'm trying a very simple test to load an
> >> > assembly(dll)  with the Late binding .
> >> > Hier is the Code i have in my application :
> >> > -----Code ----------
> >> > try
> >> >            {
> >> >                Assembly assemblyInstance =
> >> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
> >> >                                }
> >> >            }
> >> >            catch (Exception ex)
> >> >            {
> >> >                MessageBox.Show(ex.Message);
> >> >            }
> >> > -------------code end--------
> >> >
> >> > This is throwing the following exception:
> >> > Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll' or one
> >> > of
> >> > its dependencies. The module was expected to contain an assembly
> >> > manifest.
> >> >
> >> > The DLL i am trying to use is a simple dll that was created with
> >> > another
> >> > tool ( Labwindows CVI from national Instruments).  I muss notify that
> >> > it
> >> > walks , when i try the early Binding with the same DLL .
> >> > Can somebody help me ?
> >> > Thanks.
> >> >
> >> >
> >>
> >>
> >>
>
>
>
Author
16 Mar 2006 10:16 AM
Willy Denoyette [MVP]
Please tell us what you mean by calling unmanaged code using late binding.
There is no such thing like "late binding" when calling unmanaged code
unless you are talking about calling native code through COM interop, but
that's a different matter.

Willy.




Show quoteHide quote
"Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
news:DF479951-194B-4D91-B8F3-91D855AD12F9@microsoft.com...
| Hello scott,
| Thank you for your answer and for the article, but the problem is still
| remaning because the article is talking about how to call Unmanaged Code
| using the Early Binding, and i know how it walks .  My problem is now ,
How
| can i  call Unmanaged Code using the Late Binding ???? I hope you can help
me
| .
| Regards
| Entwickler.
|
|
| "scott blood" wrote:
|
| > Hello
| >
| > Rather than me writing a full paragraph explaining how to use unmanaged
| > code, you could have a  look at this article.
| >
| > http://www.findarticles.com/p/articles/mi_zddvs/is_200502/ai_n9522544
| >
| > If you are still unsure after reading this , please post back and i will
try
| > and post some easy to understand examples.
| >
| > Regards
| > Scott Blood
| > C# Developer
| >
| > "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
| > news:D94AB040-5D43-49D6-BBBD-29B39B634940@microsoft.com...
| > > hi scott,
| > > thank you for your answer. but please could you tell me how i can
specify
| > > that my dll is an unmanaged code ? i tried to find how to do it
without
| > > succes.
| > > Thanks.
| > >
| > > "scott blood" wrote:
| > >
| > >> This seems to be something to do with Un-Managed code.  Unless you
| > >> explicitly specify it, your code will not be able to use umanaged
code
| > >> and
| > >> afaik Assembly.LoadFrom requires a managed DLL whether or not you
specify
| > >> the use of unmanaged code.
| > >>
| > >> Regards
| > >> Scott Blood
| > >> C# Developer
| > >>
| > >> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
| > >> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
| > >> > I'm trying a very simple test to load an
| > >> > assembly(dll)  with the Late binding .
| > >> > Hier is the Code i have in my application :
| > >> > -----Code ----------
| > >> > try
| > >> >            {
| > >> >                Assembly assemblyInstance =
| > >> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
| > >> >                                }
| > >> >            }
| > >> >            catch (Exception ex)
| > >> >            {
| > >> >                MessageBox.Show(ex.Message);
| > >> >            }
| > >> > -------------code end--------
| > >> >
| > >> > This is throwing the following exception:
| > >> > Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll' or
one
| > >> > of
| > >> > its dependencies. The module was expected to contain an assembly
| > >> > manifest.
| > >> >
| > >> > The DLL i am trying to use is a simple dll that was created with
| > >> > another
| > >> > tool ( Labwindows CVI from national Instruments).  I muss notify
that
| > >> > it
| > >> > walks , when i try the early Binding with the same DLL .
| > >> > Can somebody help me ?
| > >> > Thanks.
| > >> >
| > >> >
| > >>
| > >>
| > >>
| >
| >
| >
Author
16 Mar 2006 10:24 AM
scott blood
I have posted a possible solution in your other post further up in the
newgsgroup

Regards
Scott Blood
C# DEveloper

Show quoteHide quote
"Willy Denoyette [MVP]" <willy.denoye***@telenet.be> wrote in message
news:%230VaALOSGHA.4900@TK2MSFTNGP09.phx.gbl...
> Please tell us what you mean by calling unmanaged code using late binding.
> There is no such thing like "late binding" when calling unmanaged code
> unless you are talking about calling native code through COM interop, but
> that's a different matter.
>
> Willy.
>
>
>
>
> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
> news:DF479951-194B-4D91-B8F3-91D855AD12F9@microsoft.com...
> | Hello scott,
> | Thank you for your answer and for the article, but the problem is still
> | remaning because the article is talking about how to call Unmanaged Code
> | using the Early Binding, and i know how it walks .  My problem is now ,
> How
> | can i  call Unmanaged Code using the Late Binding ???? I hope you can
> help
> me
> | .
> | Regards
> | Entwickler.
> |
> |
> | "scott blood" wrote:
> |
> | > Hello
> | >
> | > Rather than me writing a full paragraph explaining how to use
> unmanaged
> | > code, you could have a  look at this article.
> | >
> | > http://www.findarticles.com/p/articles/mi_zddvs/is_200502/ai_n9522544
> | >
> | > If you are still unsure after reading this , please post back and i
> will
> try
> | > and post some easy to understand examples.
> | >
> | > Regards
> | > Scott Blood
> | > C# Developer
> | >
> | > "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
> | > news:D94AB040-5D43-49D6-BBBD-29B39B634940@microsoft.com...
> | > > hi scott,
> | > > thank you for your answer. but please could you tell me how i can
> specify
> | > > that my dll is an unmanaged code ? i tried to find how to do it
> without
> | > > succes.
> | > > Thanks.
> | > >
> | > > "scott blood" wrote:
> | > >
> | > >> This seems to be something to do with Un-Managed code.  Unless you
> | > >> explicitly specify it, your code will not be able to use umanaged
> code
> | > >> and
> | > >> afaik Assembly.LoadFrom requires a managed DLL whether or not you
> specify
> | > >> the use of unmanaged code.
> | > >>
> | > >> Regards
> | > >> Scott Blood
> | > >> C# Developer
> | > >>
> | > >> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in
> message
> | > >> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
> | > >> > I'm trying a very simple test to load an
> | > >> > assembly(dll)  with the Late binding .
> | > >> > Hier is the Code i have in my application :
> | > >> > -----Code ----------
> | > >> > try
> | > >> >            {
> | > >> >                Assembly assemblyInstance =
> | > >> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
> | > >> >                                }
> | > >> >            }
> | > >> >            catch (Exception ex)
> | > >> >            {
> | > >> >                MessageBox.Show(ex.Message);
> | > >> >            }
> | > >> > -------------code end--------
> | > >> >
> | > >> > This is throwing the following exception:
> | > >> > Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll'
> or
> one
> | > >> > of
> | > >> > its dependencies. The module was expected to contain an assembly
> | > >> > manifest.
> | > >> >
> | > >> > The DLL i am trying to use is a simple dll that was created with
> | > >> > another
> | > >> > tool ( Labwindows CVI from national Instruments).  I muss notify
> that
> | > >> > it
> | > >> > walks , when i try the early Binding with the same DLL .
> | > >> > Can somebody help me ?
> | > >> > Thanks.
> | > >> >
> | > >> >
> | > >>
> | > >>
> | > >>
> | >
> | >
> | >
>
>
Author
16 Mar 2006 10:30 AM
Willy Denoyette [MVP]
My post?

Willy.

Show quoteHide quote
"scott blood" <scott_bl***@hotmail.com> wrote in message
news:%23PkALPOSGHA.5500@TK2MSFTNGP12.phx.gbl...
|I have posted a possible solution in your other post further up in the
| newgsgroup
|
| Regards
| Scott Blood
| C# DEveloper
|
| "Willy Denoyette [MVP]" <willy.denoye***@telenet.be> wrote in message
| news:%230VaALOSGHA.4900@TK2MSFTNGP09.phx.gbl...
| > Please tell us what you mean by calling unmanaged code using late
binding.
| > There is no such thing like "late binding" when calling unmanaged code
| > unless you are talking about calling native code through COM interop,
but
| > that's a different matter.
| >
| > Willy.
| >
| >
| >
| >
| > "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
| > news:DF479951-194B-4D91-B8F3-91D855AD12F9@microsoft.com...
| > | Hello scott,
| > | Thank you for your answer and for the article, but the problem is
still
| > | remaning because the article is talking about how to call Unmanaged
Code
| > | using the Early Binding, and i know how it walks .  My problem is now
,
| > How
| > | can i  call Unmanaged Code using the Late Binding ???? I hope you can
| > help
| > me
| > | .
| > | Regards
| > | Entwickler.
| > |
| > |
| > | "scott blood" wrote:
| > |
| > | > Hello
| > | >
| > | > Rather than me writing a full paragraph explaining how to use
| > unmanaged
| > | > code, you could have a  look at this article.
| > | >
| > | >
http://www.findarticles.com/p/articles/mi_zddvs/is_200502/ai_n9522544
Show quoteHide quote
| > | >
| > | > If you are still unsure after reading this , please post back and i
| > will
| > try
| > | > and post some easy to understand examples.
| > | >
| > | > Regards
| > | > Scott Blood
| > | > C# Developer
| > | >
| > | > "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
| > | > news:D94AB040-5D43-49D6-BBBD-29B39B634940@microsoft.com...
| > | > > hi scott,
| > | > > thank you for your answer. but please could you tell me how i can
| > specify
| > | > > that my dll is an unmanaged code ? i tried to find how to do it
| > without
| > | > > succes.
| > | > > Thanks.
| > | > >
| > | > > "scott blood" wrote:
| > | > >
| > | > >> This seems to be something to do with Un-Managed code.  Unless
you
| > | > >> explicitly specify it, your code will not be able to use umanaged
| > code
| > | > >> and
| > | > >> afaik Assembly.LoadFrom requires a managed DLL whether or not you
| > specify
| > | > >> the use of unmanaged code.
| > | > >>
| > | > >> Regards
| > | > >> Scott Blood
| > | > >> C# Developer
| > | > >>
| > | > >> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in
| > message
| > | > >> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
| > | > >> > I'm trying a very simple test to load an
| > | > >> > assembly(dll)  with the Late binding .
| > | > >> > Hier is the Code i have in my application :
| > | > >> > -----Code ----------
| > | > >> > try
| > | > >> >            {
| > | > >> >                Assembly assemblyInstance =
| > | > >> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
| > | > >> >                                }
| > | > >> >            }
| > | > >> >            catch (Exception ex)
| > | > >> >            {
| > | > >> >                MessageBox.Show(ex.Message);
| > | > >> >            }
| > | > >> > -------------code end--------
| > | > >> >
| > | > >> > This is throwing the following exception:
| > | > >> > Could not load file or assembly ' C:\Data\Dlls\Myfunctions.dll'
| > or
| > one
| > | > >> > of
| > | > >> > its dependencies. The module was expected to contain an
assembly
| > | > >> > manifest.
| > | > >> >
| > | > >> > The DLL i am trying to use is a simple dll that was created
with
| > | > >> > another
| > | > >> > tool ( Labwindows CVI from national Instruments).  I muss
notify
| > that
| > | > >> > it
| > | > >> > walks , when i try the early Binding with the same DLL .
| > | > >> > Can somebody help me ?
| > | > >> > Thanks.
| > | > >> >
| > | > >> >
| > | > >>
| > | > >>
| > | > >>
| > | >
| > | >
| > | >
| >
| >
|
|
Author
16 Mar 2006 11:02 AM
scott blood
Willy,

Not your post, the origonal post by Entwickler.

Sorry my news reader is messed up today, its not replying to the correct
posts.

Regards
Scott Blood
C# Developer

Show quoteHide quote
"Willy Denoyette [MVP]" <willy.denoye***@telenet.be> wrote in message
news:OMafoSOSGHA.4300@TK2MSFTNGP14.phx.gbl...
> My post?
>
> Willy.
>
> "scott blood" <scott_bl***@hotmail.com> wrote in message
> news:%23PkALPOSGHA.5500@TK2MSFTNGP12.phx.gbl...
> |I have posted a possible solution in your other post further up in the
> | newgsgroup
> |
> | Regards
> | Scott Blood
> | C# DEveloper
> |
> | "Willy Denoyette [MVP]" <willy.denoye***@telenet.be> wrote in message
> | news:%230VaALOSGHA.4900@TK2MSFTNGP09.phx.gbl...
> | > Please tell us what you mean by calling unmanaged code using late
> binding.
> | > There is no such thing like "late binding" when calling unmanaged code
> | > unless you are talking about calling native code through COM interop,
> but
> | > that's a different matter.
> | >
> | > Willy.
> | >
> | >
> | >
> | >
> | > "Entwickler" <Entwick***@discussions.microsoft.com> wrote in message
> | > news:DF479951-194B-4D91-B8F3-91D855AD12F9@microsoft.com...
> | > | Hello scott,
> | > | Thank you for your answer and for the article, but the problem is
> still
> | > | remaning because the article is talking about how to call Unmanaged
> Code
> | > | using the Early Binding, and i know how it walks .  My problem is
> now
> ,
> | > How
> | > | can i  call Unmanaged Code using the Late Binding ???? I hope you
> can
> | > help
> | > me
> | > | .
> | > | Regards
> | > | Entwickler.
> | > |
> | > |
> | > | "scott blood" wrote:
> | > |
> | > | > Hello
> | > | >
> | > | > Rather than me writing a full paragraph explaining how to use
> | > unmanaged
> | > | > code, you could have a  look at this article.
> | > | >
> | > | >
> http://www.findarticles.com/p/articles/mi_zddvs/is_200502/ai_n9522544
> | > | >
> | > | > If you are still unsure after reading this , please post back and
> i
> | > will
> | > try
> | > | > and post some easy to understand examples.
> | > | >
> | > | > Regards
> | > | > Scott Blood
> | > | > C# Developer
> | > | >
> | > | > "Entwickler" <Entwick***@discussions.microsoft.com> wrote in
> message
> | > | > news:D94AB040-5D43-49D6-BBBD-29B39B634940@microsoft.com...
> | > | > > hi scott,
> | > | > > thank you for your answer. but please could you tell me how i
> can
> | > specify
> | > | > > that my dll is an unmanaged code ? i tried to find how to do it
> | > without
> | > | > > succes.
> | > | > > Thanks.
> | > | > >
> | > | > > "scott blood" wrote:
> | > | > >
> | > | > >> This seems to be something to do with Un-Managed code.  Unless
> you
> | > | > >> explicitly specify it, your code will not be able to use
> umanaged
> | > code
> | > | > >> and
> | > | > >> afaik Assembly.LoadFrom requires a managed DLL whether or not
> you
> | > specify
> | > | > >> the use of unmanaged code.
> | > | > >>
> | > | > >> Regards
> | > | > >> Scott Blood
> | > | > >> C# Developer
> | > | > >>
> | > | > >> "Entwickler" <Entwick***@discussions.microsoft.com> wrote in
> | > message
> | > | > >> news:86CE3A7D-8BD5-4A1D-80D7-68379D8D872D@microsoft.com...
> | > | > >> > I'm trying a very simple test to load an
> | > | > >> > assembly(dll)  with the Late binding .
> | > | > >> > Hier is the Code i have in my application :
> | > | > >> > -----Code ----------
> | > | > >> > try
> | > | > >> >            {
> | > | > >> >                Assembly assemblyInstance =
> | > | > >> > Assembly.LoadFrom(@"C:\Data\Dlls\Myfunctions.dll");
> | > | > >> >                                }
> | > | > >> >            }
> | > | > >> >            catch (Exception ex)
> | > | > >> >            {
> | > | > >> >                MessageBox.Show(ex.Message);
> | > | > >> >            }
> | > | > >> > -------------code end--------
> | > | > >> >
> | > | > >> > This is throwing the following exception:
> | > | > >> > Could not load file or assembly '
> C:\Data\Dlls\Myfunctions.dll'
> | > or
> | > one
> | > | > >> > of
> | > | > >> > its dependencies. The module was expected to contain an
> assembly
> | > | > >> > manifest.
> | > | > >> >
> | > | > >> > The DLL i am trying to use is a simple dll that was created
> with
> | > | > >> > another
> | > | > >> > tool ( Labwindows CVI from national Instruments).  I muss
> notify
> | > that
> | > | > >> > it
> | > | > >> > walks , when i try the early Binding with the same DLL .
> | > | > >> > Can somebody help me ?
> | > | > >> > Thanks.
> | > | > >> >
> | > | > >> >
> | > | > >>
> | > | > >>
> | > | > >>
> | > | >
> | > | >
> | > | >
> | >
> | >
> |
> |
>
>

Bookmark and Share