Total lead time?

Something I don't want to clear up about, I understand that there are differences between C # and VB.NET (mainly when using pointers), but why, if both have Common CLR, does XNA (for example) only working with C # and not VB.NET, or is it that the addition to visual studio was aimed at C # and not VB.Net, and impose language extensions work as in

Sorry if this is an obvious question, thought I would ask

+1


source to share


3 answers


The CLR has been ported to various platforms, not all of which are equal. The XBox 360 CLR, for example, doesn't have Reflection.Emit, or even all the IL operations that the full CLR does . Consequently, another compiler may emit IL codes that are legal for the entire CLR, but illegal in the Compact CLR.

Another issue is the availability of class libraries. The complete BCL includes the Microsoft.VisualBasic namespace, which is automatically referenced by the VB.NET compiler. This contains the VB6 compatibility features , My Namespace , as well as some compiler helper features and is commonly referred to as the VB.NET runtime.

Whenever the CLR is migrated, some assemblies are migrated and others are not. For XBox, Microsoft.VisualBasic has not been ported. This means that you cannot refer to anything from this namespace. While it is quite simple not to refer to compatibility or My namespaces, compiler services can be injected into the compiled IL without you directly calling.



In VB.NET 8, you can pass the undocumented and unsupported -novbruntimeref switch to vbc.exe so that it doesn't reference Microsoft. VisualBasic.dll. Unfortunately, this sometimes led to odd compiler errors. In VB.NET 9, it becomes documented and maintained and renamed to / vbruntime .

The third case is the addition and support of Visual Studio. It depends on the individual packages, whether they support templates, gen code, etc. For every language. I believe some third party developers have released VB.NET templates for XNA, although not officially supported .

In the end I think it's a combination of technical issues (CLR ports, BCL availability, IL compiler release) and support (testing, funding, and additions for other languages).

+3


source


It is a set of tools that determines support for a language. XNA, for example, just did all its work with C # and only posted support for it. You can still write your application in VB.NET and manually compile it from the command line. As long as your application is not compiled for any illegal IL (opcodes that XNA does not support) it will still work. The main issue is resources - they don't have the workforce to fully develop and test all languages, so they chose it.



+4


source


Of all accounts, VB.NET and C # are equivalent to 99.9999 when it comes to CLR. But there are some minor differences that might bite you. In addition, I remember reading on the Microsoft blog that there are some things the CLR can do that are not yet programmed by VB.NET or C # and should be done by IL. Interesting, really.

+1


source







All Articles