将调用类的引用传递给DLL的问题 [英] Problem passing in reference of calling class into DLL

查看:63
本文介绍了将调用类的引用传递给DLL的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我将调用类(在我的

..exe中)的引用传递给DLL时遇到了一些问题。这两个程序都是C#,我想要做的是将一个类的

引用传递给DLL函数。当我尝试编译DLL

时,我得到类型或名称空间名称MyForm找不到。


我想我必须引用这个类但是因为需要在EXE之前构建DLL

看起来我有一个鸡和蛋类型的问题。它是否可以这样做?b / b
谢谢。



I am having a little problem passing in reference of my calling class (in my
..exe)into a DLL. Both programs are C# and what I am trying to do is pass a
reference to my one class into a DLL function. When I try and compile the DLL
I get "The type or namespace name "MyForm" could not be found.

I think I have to reference the class but since the DLL needs to be built
before the EXE it looks like I have a chicken and egg type problem. Is it
even possible to do this?

Thanks.

推荐答案

Scott,


您可以在一个DLL中定义您的类型,该DLL与DLL分开,与EXE一样,然后从EXE引用它EXE和dll。那个

可以解决你的问题。


希望这会有所帮助。

-

- 尼古拉斯Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" scottt" < SC **** @ discussions.microsoft.com>在留言中写道

news:00 ********************************** @ microsof t.com ...
Scott,

You could define your type in a DLL that is separate from the DLL as
well as from the EXE, then reference it from both the EXE and the dll. That
would solve your problem.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"scottt" <sc****@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...


我在调用我的调用类时遇到一点问题(在
我的
.exe中) )进入DLL。这两个程序都是C#,我想要做的是将我的一个类的引用传递给DLL函数。当我尝试编译
DLL
时,我得到类型或命名空间名称MyForm找不到。

我想我必须引用这个类,但是因为需要在EXE之前构建DLL,所以看起来我有鸡和蛋类型的问题。是否可以这样做?

谢谢。


I am having a little problem passing in reference of my calling class (in
my
.exe)into a DLL. Both programs are C# and what I am trying to do is pass a
reference to my one class into a DLL function. When I try and compile the
DLL
I get "The type or namespace name "MyForm" could not be found.

I think I have to reference the class but since the DLL needs to be built
before the EXE it looks like I have a chicken and egg type problem. Is it
even possible to do this?

Thanks.



Scott,

您可以在DLL中将您的类型定义为与EXE分开的DLL和/或$ EXB,然后从EXE和dll引用它。那个

会解决你的问题。


希望这会有所帮助。

" scottt" < SC **** @ discussions.microsoft.com>在留言中写道

news:00 ********************************** @ microsof t.com ...
Scott,

You could define your type in a DLL that is separate from the DLL as
well as from the EXE, then reference it from both the EXE and the dll. That
would solve your problem.

Hope this helps.
"scottt" <sc****@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...


我在调用我的调用类时遇到一点问题(在
我的
.exe中) )进入DLL。这两个程序都是C#,我想要做的是将我的一个类的引用传递给DLL函数。当我尝试编译
DLL
时,我得到类型或命名空间名称MyForm找不到。

我想我必须引用这个类,但是因为需要在EXE之前构建DLL,所以看起来我有鸡和蛋类型的问题。甚至可以这样做吗?

谢谢。


I am having a little problem passing in reference of my calling class (in
my
.exe)into a DLL. Both programs are C# and what I am trying to do is pass a
reference to my one class into a DLL function. When I try and compile the
DLL
I get "The type or namespace name "MyForm" could not be found.

I think I have to reference the class but since the DLL needs to be built
before the EXE it looks like I have a chicken and egg type problem. Is it
even possible to do this?

Thanks.






谢谢你的那种我的最后一个选择,因为我也在与

作斗争X在多个地方定义警告信息也是。代码工作的时候它只是一个名字空间,但是因为我已经把这部分代码拉出来了

成为一个DLL我已经运行到多个定义的地方各处

代码。


还有其他选择吗?


谢谢。


Nicholas Paldino [.NET / C#MVP]"写道:
Thanks that is kind of my last resort option since I am also battling with a
"X is defined in mutiple places" warning message too. The code worked when it
was all under one name space but since I have pulled out this section of code
to be a DLL I have been running into the defined in multiple places all over
the code.

Are there any other options?

Thanks.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Scott,

你可以在一个DLL中定义你的类型,它与DLL分开,以及从EXE,然后从EXE和dll引用它。

希望这会有所帮助。

" scottt" < SC **** @ discussions.microsoft.com>在消息中写道
新闻:00 ********************************** @ microsof t.com。 ..
Scott,

You could define your type in a DLL that is separate from the DLL as
well as from the EXE, then reference it from both the EXE and the dll. That
would solve your problem.

Hope this helps.
"scottt" <sc****@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...


我有一个小问题,将我的调用类(在
我的
.exe中)引用到DLL中。这两个程序都是C#,我想要做的是将我的一个类的引用传递给DLL函数。当我尝试编译
DLL
时,我得到类型或命名空间名称MyForm找不到。

我想我必须引用这个类,但是因为需要在EXE之前构建DLL,所以看起来我有鸡和蛋类型的问题。甚至可以这样做吗?

谢谢。


I am having a little problem passing in reference of my calling class (in
my
.exe)into a DLL. Both programs are C# and what I am trying to do is pass a
reference to my one class into a DLL function. When I try and compile the
DLL
I get "The type or namespace name "MyForm" could not be found.

I think I have to reference the class but since the DLL needs to be built
before the EXE it looks like I have a chicken and egg type problem. Is it
even possible to do this?

Thanks.




这篇关于将调用类的引用传递给DLL的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆