The VS is set to default VisualBasic, but I need to import existing C# projects into my solution, where I already have the VB project.
But when I try to add an existing project to the solution and navigate to the C# project - I can't see the project file. From the drop-down settings menu I have the possibility to import only .vbproj and other .vb...
I tried to create new C# project, but I can only make VB and some office tools and Web. I don't have C# possibility, so I suppose it's because the Visual Studio has been set to VB only.
How can I add/change settings so I can create/import C# projects, as well?
EDIT: I tried going to Tools->Import and Export Settings... but I didn't have the possibility to import C# development settings or whatsoever. I could only add Project dev. set. and VB dev. set.
P.S. It's not my computer, so I was not the one to install the Visual Studio and I don't know what settings were set/installed.
If you are using the Visual Studio Express Edition for VB.NET; then that's not possible.
Visual Basic will most likely be selected as your default programming language. When creating a new project you can select a different language by collapsing the 'Other Languages' folder. If this does not contain C# you will have to install C# support for VS.
You can do this at 'Add and Remove Programs' or 'Programs and Features' and then changing the Visual Studio installation. Select the C# feature and after the installation completes you should now be able to open, add and create projects with C#.
Related
If it's not exist in the express version, is there any other way to make Windows Control Library ?
This is what I see when trying to make a new project:
If you mean as in a COM .ocx file, that's not how .net works. You might even have to get Visual Studio 6 installed to do that, although I suppose check out the other project types. It's also possible there are other project types that are not installed by default, so try re-running the VS installer and see what else is available.
For a .net controls library you should create a class library and add your forms to it. VS will add the necessary references for you, and you can then reference that assembly from any other managed code.
In Visual C# Express Edition, according to this :
Windows Control Library: Missing Windows Control Library Template
Windows Control Library Template should be same as : Class Library project template
But with added reference to System.Windows.Forms.dll.
I found another trick to create this missing template for visual studio 2013 Express, With the help from this link:
http://www.dotnetspider.com/resources/21844-How-add-windows-control-library-template.aspx
So the steps for C# express 2013 are nearly the same than in the example witch is about c# 2005
Open Visual C# Express 2013.
Create New windows Application with the name: MyLibrary
From the Project menu select Add User Control. Click on Add
Close any forms windows.
(a view with the Form already closed)
In Solution Explorer, Delete forms related files
(the corresponding .cs files should be deleted by this step)
From the Project menu select MyLibrary Properties.
In the Application tab set the Output Type to Class Library.
In the file Program.cs replace
Application.Run(Form1)
with
Application.Run()
Build the Solution. There should be no errors and the bin/Release folder should have a MyLibrary.dll file (i found it in Debug in my case)
From the File menu select Export Template.
Select Project Template then Next .
Under Template Options change the name of the template to Windows Control Library and the Description to Create windows Control .dll. Click on Finish.
Close C# Express 2013.
The next time you open Visual C# Express, you will find your newly created template ready to use.
Visual Studio 2010 keeps defaulting to VB.NET projects instead of C#, I imported my saved settings from 2008 which defaulted to C# projects which did not resolve the problem..
I always accidentally create VB.NET projects then slap myself in the face as I then proceed to delete the project and recreate a C# version of it.
Tools -> Import and Export Settings -> Import Selected Environment Settings... -> Make selection whether to save current settings -> Select C# under the default setting folder
Edit: Checking in with VS Pro 2019 and this appears to still be the flow.
Visual Studio (2008..and hopefuly '10 =x) defaults to whatever you chose as the last project's code language you created. Double check that yours isn't doing this >_< Try creating a new project in C# code, exit that project, and create another one and see what language it defaults to. If so, it will allow to keep your "Web Development Settings" rather that switch your main environment to C#, like the other solution suggests.
I haven't deployed the application yet. I'm new to this, how can i create folders under C:\Programs Files during installation? Should i put the snippet of creating folders in program.cs?
The application is Winform in C#
In Visual Studio, use the MSI Installer Wizard template to add an Installer to your solution.
Using this template you can set up the appropriate folders (also registry keys, start menu shortcuts etc.) to create when you deploy your project.
In Visual Studio 2008 this template is under Other Project Types->Setup and Deployment->Setup Wizard.
Use deployment (setup) project. it will create this folder for you
Add a Setup project to your Solution And then add Primary output and all the files needed.
From the Property windows of the setup project you can choose default location where to save
your projects which I usually do in my projects.
Refer this for more info http://msdn.microsoft.com/en-us/library/ms235317%28VS.90%29.aspx
I strongly recommend WiX over the visual studio deployment project. It has a bit of a learning curve, but it's worth learning it.
When starting Visual Studio 2008 you are asked to choose a programming layout (preset?), which can be C++ or C# (or generic?). Few months ago I choose the C++ preset because I was working on a C++ project, while now I'm working to a C# project. Is there a way to reset the Visual Studio layout to C#?
Go to:
Tools > Import and Export Settings
Import selected environment settings
Yes, save my current settings (if you want to backup current settings; No, if you don't want to)
Choose one of the following under Default Settings:
General
JavaScript
Visual Basic
Visual C#
Visual C++
Web Development
Web Development (Code Only)
Notes
Alternatively, in step 2, you may choose Reset all settings.
You may also use /ResetSettings command line switch.
For Visual Studio 2015 it's the same steps described by #Dariusz Woźniak but you can select "Reset all settings" instead of "Import" on step 2.
I have a VSPackage for Visual Studio 2008 that I created for adding some editor and custom language functionality. I also have a need to add a new project/solution wizard to create a new Solution and a complex series of C++ projects to the solution. I know I can do this using a "Custom Wizard", but I would be much happier if I can implement this within my VSPackage using C# instead.
So I guess the main question is, is it possible to add an entry to the Project Types dialogs in Visual Studio from a VSPackage? Or is the "Custom Wizard" and JScript my only option here?
And if it's possible, where can I find information and/or samples on how to accomplish this?
To add an entry to the Project Types dialog, you need to install a project template (a zip file containing a .vstemplate file) as part of your installation. You will want to do this from your setup routine rather than from the VSPackage itself.
However, your .vstemplate can invoke a wizard written in C#. Although this is indeed a "custom wizard," you can provide a reference to a .NET assembly. There is no need to use a scripting language.
For an example, see IronPython > C# Example.IronPythonProject in the VS2008 SDK browser. Unfortunately this demonstrates only limited wizard functionality and only for project items rather than projects, but I hope it will be useful all the same.