calling a vb.net class from c# in VS2010 - visual-studio-2010

So i am working on a wpf browser project in c# but on of the class library's I need is in vb.net. So in VS2010 I have imported the solution called vblib and it shows up on the solution explorer. The class i need is public class vbintopm. So right now I have
using vblib;
//down a few lines
vbintopm callvb= new vbintopm;
>
now I keep getting errors that VS can't find class even though its in the solution explorer. What do i need to fix to this?

You need to actually reference the library from your C# project. Right-click the project and then select "Add Reference". On the "Projects" tab, select the project and click "OK".

Related

How do you change the default programming language visual studio 2013?

I installed Visual Studio 2013 again after I got a new PC, but now when I create a new file it creates it as an VB file instead of c#.
I changed the default programming language in web.config like shown here:
I tried reloading the project but it still does not work.
The web project is placed on a local ftp server.
When you make a new project, under Templates you should see a node for Visual Basic and one for Visual C# with the different types of projects listed under the language. I believe VS remembers which one you used last.
The menu that shows up when you right click on a folder > "Add" shows a list of the options available for that folder ex. if you are in App_code it shows "Class". It seems it doesn't change the first suggestion to C# class even tho you change the programming language. So to fix that you go into the same menu and pick "Add New item..." and select C# Class file ...close it. Now if you try and create a file again it still says "Class" in the Add menu, but when you select it now, it creates it as an C#.
Sovled the problem for me. Thanks to all of you leading me to the answer.

What makes a project publishable in visual studio?

I'm unclear on what makes a project in visual studio "right click publishable", does anyone have an idea/information on this?
I realize that project types such as console apps, web apps, etc should be right click publishable. However, I'm struggling with figuring out what makes a class library right click publishable. I have several class libraries that I've created that don't have "publish" available as an option when right clicking the project file in visual studio, however I have happened across a class library project from another developer that has the option to right click publish.
What/where is the right click publish option configured on a project?

Generate a class diagram from Visual Studio

I would like to generate a class diagram with relations for my visual studio project. I opened my solution, added a new ModelingProject, added a new .classdiagram file but when i want to drag my folders or my classes onto the diagram layout I get the "not available" sign.
Does anyone has any idea on how to fix this ?
For Visual Studio 2017, 2019 and 2022
This feature is still available, but it is NOT installed by default, you have to install it separately.
From inside Visual Studio go to Tools -> Get Tools and Features
Select the Individual components tab and search for Class Designer
Check this Component and Install it
After finish installing this component
Right-click on the project and select Add -> Add New Item
A. Search for 'class' word and NOW you can see Class Diagram component
Very Important Update From the Comments below
Right-clicking on a folder and selecting Add New Item will NOT show the Class Diagram option.
You could right-click on a project.
Not every project type will support Class Diagram For example,
Right-clicking on Class Library project will DO show Class Diagram option in the Add New Item dialog.
But Right-clicking on ASP.NET project will NOT show Class Diagram option in the Add New Item dialog.
For generating the class diagram visual studio is providing the in-built option please use that, Go to class view window of your project, RightClick -> select View -> click on View Class Diagram. This will generate class diagram for your project.
Ref:
https://msdn.microsoft.com/en-us/library/ff657806.aspx
How to generate class diagram from project in Visual Studio 2013?
Thanks

Wizard to add non-MFC C++ class in Visual Studio 2010?

Up to now I have always adding a new non-MFC C++ class in Visual Studio (I use 2010 these days) by right clicking on "Header Files" and adding a header file for the class and then right clicking on "Source Files" and adding a source file for the class. I then fill out the contents manually. It takes under a minute but it would be SO nice if there was a wizard for this.
Is there a wizard to add a new non-MFC C++ class in VS2010?
Right click on the project in Solution Explorer. Click Add->Class, you can find C++ class in the pop-up window.

Visual Studio: Make view code default

Is there any way to make Visual Studio show the code of a control / form by default instead of the designer? I tend not to be a fan of the designers as they add bloat.
Right-click on a file and select "Open With..."
Select "CSharp Editor" and then click "Set as Default".
Decorate your class with [System.ComponentModel.DesignerCategory("")], e.g.:
[System.ComponentModel.DesignerCategory("")]
public class MySpecialButton : System.Windows.Forms.Button
{
}
I like having my forms open up in Design View, but I made a partial class file which had only code and Visual Studio wanted to open it in Design View all the time. To prevent Visual Studio from realizing that a specific source file can be loaded by Designer, look at the csproj file for the Compile Include tag of the appropriate source file and remove the SubType tag underneath it.
I came across this issue myself recently and the above solutions did not solve my issue. I needed to go into Tools | Options and change the settings for HTML Designer to Enable HTML designer and select Start pages in: Source View.

Resources