Is there a way to configure the current solution such that every new project created (or imported possibly) has references that you can configure rather than having to go through every project and add reference?
You can't configure solution for adding references to newly created/imported projects. But you can export a project template based on your project:
Create new project
Add desired references to this project
Invoke File -> Export Template... menu item
Select "Project Template" option and desired project in combo-box
Set template name on next page and click finish
Now you can create project from template you've created and it will have references you've added on step 2.
Related
I'm using VisualStudio express 2017 as the IDE. I have set up everything for the OpenGL and everything works fine. But there is a problem, I realized that I have to set up the library and dependencies every time when I create a new project. Can anyone help me with this problem?
There's a solution to that called a Property Sheet. Since I don't use VS Express, I'll explain how to create and reuse properties for a Visual Studio Community Edition project.
Create a new project, for example a C++ Console Application (or whatever programming language you're using)
To display Property Manager go to View > Property Manager or View > Other Windows > Property Manager
In the Property Manager, left-click on the "triangle symbol" next to your project name to display the configurations.Choose the configuration you want to set up (here Debug | Win32 is highlighted)
.
Right-click on the configuration. Choose Add New Project Property Sheet. A property page dialog box appears. Enter a name (file extension .props) and where to save it. Click Add.
Left-click on the "triangle symbol" next to your configuration. You should now see your newly created property sheet. Double-click on it.
Now configure your project how you want, include dependencies , libraries, Linker etc.
After configuring, right-click on your property sheet. Save it.
Now everytime you create a new project, right-click on your project name in the Property Manager and click Add existing property sheet and brwose to its location.
When exporting a project as a template in Visual Studio I noticed that the "TargetFramework" property of the .csproj file in the .zip archive is not parameterized but hardcoded as the framework version used to create the project from which the template.
My question is - is it possible to create a project template but make it so that the "TargetFramework" property is changed depending on the user's settings/machine/etc.?
If you want to honor the framework selected by the user on the new project dialog, you can use the targetframeworkversion parameter, so the csproj template would be <TargetFrameworkVersion>v$targetframeworkversion$</TargetFrameworkVersion>.
If you don't want the user to select the target framework version, you should disable the corresponding combo box on the new project dialog, I don't know if there is a way to achieve this. Then, on the project wizard, you have to either set the value of the parameter targetframeworkversion or add your own parameter.
I have some shared projects which I use in a lot of other projects. My workflow for a new project is like this:
Create blank VS solution (check "Add to Source Control" in the New Project dialog)
Paste shared project folders into the solution folder
Add the shared projects to the solution by right-clicking the solution in VS, then selecting Add -> Existing Project and selecting the shproj-file of the pasted shared project
The shared project is now added to the VS solution, but it's not added to source control. Is there anything I can do to automatically add this project type to source control?
Adding an existing project of another type automatically adds it to source control. I expected it to behave the same for shared projects.
I want to add a bunch of existing projects to the solution in Visual Studio 2017. Those projects aren't originally intended to work in VS, so I am using File --> New --> 'Project From Existing Code' to make them usable there.
VS creates a new solution for every project during the creation of "Project From Existing Code". Can I change it so it will add such project to the existing solution at the time of creation?
The process I am using to add created from existing code projects to the solution:
I initially work with VS solution (which can contain projects).
I create a new project from my existing code (File --> New -->
Project From Existing Code).
VS builds up its specific project files as well as solution file in the new project folder, closes currently opened solution and opens newly created one.
I repeat for every project I want to include in one solution.
I reopen the solution I was originally working on in VS and I add the projects to the existing solution (native VS projects I just created).
I go to the each project's folder in File Explorer and delete solution in each of them to reduce the clutter.
The simplest would be:
Create a new solution.
Remove the project that was part of the template.
Import the existing projects one at a time (right click on the solution --> Add --> Existing Project)
I am using microsoft visual basic to create a VB6 application. Application is basically a usercontrol. I have a form in the applicaton.
What i need to do is as we do in Visual Studio 2008 add a new project in the same solution and set the project as a startup project ?
In VB6 You can have Project Groups (similar to solutions in Visual Studio .NET)
Project Groups contain usually two or more VB6 projects and have the extension .vbg
To create a project group open up one project, Click File>Add Project and add a second project. When you click on save you will be prompted to save the Project Group File.
To specify one project as the startup project right click on the project and select Set as Start Up
Once you've added the new project, right click on it, an go to properties, where you'll have a form as shown below;
As you can see in the image, you've got the Start up option, where you can just drop it down and choose form to start up.
For setting a PROJECT as start up, you can simply Right-click on the corresponding form select Set as Start Up from the context menu.
Visual Basic displays the startup project's name in bold type in the Project window.