avatar
y*t
1
VB.NET和C#混合语言编程,已经有一个C#写好的Class了,Source.
在Visual Studio.Net里面建了个VB.NET Project, 把这个C# Source文件
加入了Project
现在想在VB.NET里面Inherit/Instantiate这C# Class,
怎么办?直接引用不认
avatar
p*n
2
you will just need to compile it into a dll, put it into the /bin
directory of your VB.NET project, add a reference to it in your VB
project, and then you can access the namespace and class.

【在 y*t 的大作中提到】
: VB.NET和C#混合语言编程,已经有一个C#写好的Class了,Source.
: 在Visual Studio.Net里面建了个VB.NET Project, 把这个C# Source文件
: 加入了Project
: 现在想在VB.NET里面Inherit/Instantiate这C# Class,
: 怎么办?直接引用不认

avatar
y*t
3
你这个办法是可以,但是要先把C# Class编译成DLL, 不方便,
也不方便Debug, 比如从VB.NET Code一直Trace到C# Class里面去, 发现有问题改了C#
Class之后还得重新再来一遍,不够Seamless Integrated
最好能一个Project里面直接就支持多种Program Language的Source

【在 p***n 的大作中提到】
: you will just need to compile it into a dll, put it into the /bin
: directory of your VB.NET project, add a reference to it in your VB
: project, and then you can access the namespace and class.

avatar
a*a
4
why not just add a ref to the project in the same solution? that's
easier.

【在 p***n 的大作中提到】
: you will just need to compile it into a dll, put it into the /bin
: directory of your VB.NET project, add a reference to it in your VB
: project, and then you can access the namespace and class.

avatar
p*n
5
i don't think it is supported in the current .Net framework and VS.Net right
now. with the .NET IDE you can have a solution that has a VB.NET project
and a C# project and use debugger to step from one project to another
but you have to use the same programming language in each individual project

【在 y*t 的大作中提到】
: 你这个办法是可以,但是要先把C# Class编译成DLL, 不方便,
: 也不方便Debug, 比如从VB.NET Code一直Trace到C# Class里面去, 发现有问题改了C#
: Class之后还得重新再来一遍,不够Seamless Integrated
: 最好能一个Project里面直接就支持多种Program Language的Source

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。