Can we have / class files in C#.NET project…?

No, You can not mix vb and c# within the same project,but you can use them in the same solution. An assembly/project (each project compiles to 1 assembly usually) has to be one language. However, you can use multiple assemblies, and each can be coded in a different language because they are all compiled to MSIL.

You can add files to a project. Compilation also works. It compiles fine and didn’t complain because a  C# project will only actually compile the .cs files. It will ignore the other ones, therefore you will not receive errors.

Note: If you add a .vb file to a C# project, select the file in the Solution Explorer panel and then look at the Properties panel, you’ll notice that the Build Action is ‘Content’, not ‘Compile’. It is treated as a simple text file and doesn’t even get embedded in the compiled assembly as a binary resource.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s