Visual Studio - How to use an existing vsproj's project settings as a template for new project? - visual-studio-2005

There is some software I want to write a plugin for. The software includes some sample plugins. I want to create a new fresh project but I want to use one of the sample plugin vsproj's project settings as a template.
It doesn't seem very clear on how to do this. If I do "New Project From Existing Code" that only imports the cpp, h, etc files into the new project.
Right now the only way I can see to copy a sample projects settings is to open two instances of VS2005 next to each other and simply mimic the settings... Surely there is a built in method of doing this?

You could copy the project file and remove all the source files from it.
Then add your new source to that.
Doesn't the software provide a template? When I worked on toolkit that allowed developers to write their own plugins we provided these.

Related

Building related projects on Visual Studio

I am a Visual Studio noob. My background is more Unix-related and mostly used to building things via scons or make. I don't even have much Eclipse experience.
Anyway, I am frustrated how it seems very difficult to move files between projects in VS. (I am running Visual Studio 2013). For example, suppose I have a ProjectXRel (release) and I want a ProjectXDev (development). I want them both to be runnable, and the dev version might have just a few editing changes that differ it from the rel version.
The intuitive thought is to just copy the files from ProjectXRel to create ProjectXDev, but VS seems to fight me on that (it wants to rename all the namespaces to the title of the project).
Also, some of the files, like .cs files derived from .dbml via OR designer, seem uncopyable, and rely on one replicating the process of using the utility to having valid files. I'm used to a project being defined by its files, but that's not really the case in VS. Instead it seems defined by process steps used to create and organize the files.
Also, do serious developers just use command line calls and powershell? That's seems harder, but at least you know what the %#$$# is going on.....
So, the basic question is, how does one replicate an existing project to produce a similar one for development purposes? (I know source control such as git could help with that, but that's not an option for this situation.)
Thanks!
You should be using the same project for both Development and Release.
The things that are different between Development and Release should be stored in a config file (web.config or app.config, depending on what type of project).
You should then be using Configuration Transformations to transform that .config file into Development or Release.
In Visual Studio, right click on the project and click Add New Item, select "Application Configuration File".
In this file you can put connection strings or key/value pair settings in the AppSettings element (MSDN Link).
Once you have your basic settings defined, you can then right click on the config file and click Add Transformation. This will add transformations for each of the Project Configurations you have. (by default Debug and Release).
It will look like this:
Now you can build deployment packages.
Or install Slowchetah and then when you press F5 to debug it will run the selected project configuration with the configuration transformation applied.

How to force VisualStudio not to create Win32 platform

This is more question of curiosity, the behavior is annoying, but something I can live with.
I'm working on 64b only C++ application in Visual Studio. It consists of more projects, and I deleted the Win32 Configurations from all of them (and also Win32 Solution Configuration). But, when I add new project, it is Win32, and also creates Win32 + MixedPlatforms Solution Configurations, and I need to go to Configuration Manager and delete those.
Is there any configuration how to forbid this? I'm using VS2012.
Thanks
It is pre-baked in the project template that you selected to get your project started. VS2012 makes it easy to customize that template. Get started with your favored standard template. Modify it, like using Build + Configuration Manager to first add the platform target you want, then deleting the Win32 configuration you don't want. Etcetera.
Then use File + Export Template. Keep the "Project template" selection, Next, fill out the dialog and save it. Presto chango, pick that template for your future projects.

Automatically specify build configuration settings for multiple generic QtCreator projects

I would like to automatically generate *.creator, *.files, *.includes, and *.config files for each of several hundred projects in a large workspace. I would like each project to build using an external tool via a custom build kit and set of build configurations. From what I've read about QtCreator, it seems to me that the only way to do this would be either to generate the *.creator.user file for each project in advance and include the necessary build configurations, or to open each project, allow QtCreator to generate the *.creator.user file for that project, and then insert the build configuration information into the file. Rather than generating or retroactively editing an entire *.creator.user file, I'd like to generate something like a *.pro.shared file (http://doc.qt.digia.com/qtcreator-2.4/creator-sharing-project-settings.html) that could be identical for every project and wouldn't require messing with all the other user settings. Unfortunately, it doesn't appear that there is any analogous *.creator.shared file that can be used by QtCreator to incorporate shared settings. Is there a better way to approach this problem?
The build settings are basically the reason why you can not share a .user file: They contain references to data that is specific to one Qt Creator instance. These are mostly ids for Qt versions, tool chains and kits.
You can create .user files, there should be no problem with that, provided you insert the ids that are used in your creator instance. If you do it wrong, then creator will just throw away those settings and then regenerate them using default values.
Make sure to include ProjectExplorer.Project.Updater.FileVersion or creator will update your configuration using a series of transformation steps, which will most likely break everything (provided you did not start out with data compatible with Qt Creator version 1.3:-).

Visual Studio 2010 2 projects in 1 solution

I have Console version of app, developed earlier and want to have MFC visualization of it, but with ability to run Console version too. Is it possible to add new project next to existing Console project in the same solution?
Also, I have to link libraries statically.
Yes absolutely it is possible, that is what a Solution file is for. All you have to do is right click in the Solution Explorer and add a new project, the solution file will be created for you.
If you do have multiple projects, you can also specify to start more than one of them when you want to debug, just right click on the solution in Solution Explorer->Properties, Common Properties->Startup Project, then select the Multiple Startup Projects radio button.
Yes, you can have many projects in one solution. Not sure, that you can reference exe file as library for MFC project. For CLI project, yes - you can do that.
Yes you can - add a new project and add files to it. You don't have to link statically, you can link exactly as you want. In fact, you can also copy the old project file edit its contents to rename it and add that to the solution and then remove/add particular files you want.
Its not like C# where you have to mirror the on-disc layout of your project files, C++ files can be referenced where-ever you like.
An alternative would be to add a new build target (eg debug, release, and add 'console - debug' and 'console - release'), then you can mark files as excluded from the builds based on their target, so you can have 1 project that builds 2 slightly different versions of your project.

Visual Studio Solution Template - Link Source Control Projects

My team is creating some standard VS solution templates. We have a well-defined project structure, resources, etc. that we need to use every time we start a new project and this is the perfect solution. The basics work nicely.
However, as well as defining folder structure (etc.) it would be nice to be able to import a number of projects from VSS/TFS. We have a number of shared assemblies that will be used by all projects and it would be awesome to add a reference to these projects when creating a new project via our template. Can anyone tell me if this is possible and, if so, how it can be achieved?
I think there are 3 types of items you might want to templatize (is that a word?).
New Solution
New Project added to a solution
New item added to a project
I'm not sure whether its possible to add existing projects to the solution that is created when a project template is run. http://msdn.microsoft.com/en-us/library/ms185308.aspx shows how to create multiple project templates. You may have to either manually add them to the solution or create a script that modifies the .sln file to do that part.
Adding an assembly reference to either a project or item template is easily doable. The project template is pretty simple since you just need to modify your .vstemplate file for the project template(s). See http://msdn.microsoft.com/en-us/library/ms171405.aspx for reference.
Adding a new assembly reference when you add a new item from a template is a bit harder but can also be done. See http://msdn.microsoft.com/en-us/library/ms185290.aspx for more.
Have fun!

Resources