命名空间在VB.Net中不可见,但在C#中可见 [英] Namespace is not visible in VB.Net , but it is visible in C#

查看:113
本文介绍了命名空间在VB.Net中不可见,但在C#中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了两个窗口项目,一个使用vb.net(Project-1),另一个是C#(Project-2)。



我在两个项目中添加了一个引用(第三方API-TD_SwigCoreMgd)。

我想看到TD_SwigCoreMgd中的所有ENUM 。打开obejct浏览器查看所有类和ENUM。



但是在vb.net项目的情况下找不到一个ENUM(Teigha.Core.OdCmEntityColor.ColorMethod) 。在对象浏览中不可见。



在C#项目中可见(Teigha.Core.OdCmEntityColor.ColorMethod)



i找不到什么问题?

I have created two window projects , one using vb.net(Project-1) and other is C#(Project-2).

I have added a reference(3rd party API-TD_SwigCoreMgd) in two projects.
I wanted to see all the ENUM in the TD_SwigCoreMgd. open the obejct browser to see all the classes and ENUM.

But one ENUM (Teigha.Core.OdCmEntityColor.ColorMethod)is not found in case of vb.net project.It is not visible in the object browse.

It(Teigha.Core.OdCmEntityColor.ColorMethod)is visible in case of C# project

i couldn't found what is wrong ?

推荐答案

不,我不相信。由于C#和VB.NET是不同的项目,它们可能不完全相同。你没有提供任何证据。例如,该命名空间可用于在某个第三个程序集中定义您的类型,您在一个项目中正确引用但在另一个项目中没有。此外,它可能是GAC中的程序集,包括来自不同版本的.NET FCL的程序集。有时,不同版本的程序集中的类型集可能不同。或类似的东西。



怎么办?您可以自动将整个程序集翻译成其他语言。您可以使用开源ILSpy执行此操作: http://ilspy.net [ ^ ]。



我的意思是,你可以做这个练习来找出语言没有区别,看看如何使用另一种语言来使用第三方程序集及其某些类型。 [结束编辑]



另请参阅我过去的答案以及解释如何执行此操作:代码解释,C#到VB.NET [ ^ ]。



-SA
No, I don't believe that. As C# and VB.NET are different projects, they can be not quite identical. You presented no evidence they are. For example, that namespace could be use to define your type in some 3-rd assembly, which you correctly referenced in one project but not in another one. Moreover, it could be an assembly in GAC, including one from .NET FCL of different version. Sometimes the set of types in assemblies of different versions can be different. Or anything similar to that.

What to do? You can translate the whole assembly into a different language automatically. You can do this using open-source ILSpy: http://ilspy.net[^].

I mean, you can do this exercise to find out that the language makes no difference and to see how the use of the 3rd-party assembly and some type of it can be done in another language. [END EDIT]

See also my past answer with the explanation how to do that: Code Interpretation, C# to VB.NET[^].

—SA


这篇关于命名空间在VB.Net中不可见,但在C#中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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