Does a .cs
(C#) file compile under a .vbproj
(VB.NET project) ? (VS 2005, .NET 2)
Say I have Ani开发者_运维百科mals.vbproj (namespace Animals
)
I have Wolf.vb, Tiger.vb, Cat.vb, and a Human.cs
Could I use Animals.Human
from a external AnimalsForm.vb form? Why?
No, language selection is PER PROJECT, with every project resulting in a separate assembly.
You COULD use ANimal.Human from an external form is referencing both assemblies, as the namespace has actually NOTHING to do with the project (you are free to use whatever namespace you feel like in any assembly), so the same namespace can be in multiple assemblies.
No, it has to be in a seperate assembly. Just make a reference to the C# assembly and instantiate the C# class as you would any other class.
精彩评论