How do I create a project in Visual Studio not meant to compile? - visual-studio-2010

I've got a Visual Studio 2010 solution that I would like to add a project to that only contains some command-line scripts. This project isn't meant to actually compile/build anything, but I want to be able to edit my scripts with the rest of the solution, and have TFS integration etc.
Unfortunately, in searching I get a lot of results for errors where builds don't happen, or other conditions where specific build targets are implemented. I simply want a non-build project in VS as a visual repository for the editor. I don't want to one-by-one include individual files in a solution folder.

In the build configuration manager (On the Menu, "Build", "Configuration Manager"), there is a "build" checkbox for each project. Uncheck it for your script project.

Could you make a content project, add your scripts to it, then change their properties to "Do not compile"?

Related

Reduce Workflow Foundation project build time

I am working on a WF project which has many processes and code activities in it.
The project takes too long to build (20-30 times more than any other project in the solution).
I've asked google about this, but there seems to be no information.
Please, how can I reduce the build time of a Workflow Foundation project?
The main part is probably that all XAML based composite activities get validated during build. That means, they get instantiated!
You can turn that off with an undocumented setting in the csproj file:
<SkipWorkflowValidation>true</SkipWorkflowValidation>
<DisableWorkflowCompiledExpressions>true</DisableWorkflowCompiledExpressions>
This setting must be added to all configuration sections (the relevant elements, typically, you’ll want do to this in all the configurations).
The project file (csproj or vbproj extension) can be edited in Visual Studio by following these steps:
Right-click on the project in Solution Explorer and select “Unload Project”
Right-click on the unloaded project (now shown with the “(unavailable”) postfix), and select “Edit ”
The project file opens in the Visual Studio editor and you can manually edit it.
Once you are done editing the file, you can right-click on the project in Solution Explorer and select “Reload Project”.
Try that and watch the build time. But be aware, this will skip some tests during build that might be valuable...

How to regenerate designer code for all SpecFlow features

I've got ~30 SpecFlow feature files, and I recently removed the Foo.feature.cs files from source control because I got sick of resolving merge conflicts in Designer Generated code.
I did not exclude or remove these files from my Visual Studio project, so Visual Studio still thinks they should be there, they are just missing on the hard disk.
Ideally I'd like to just click on a root folder and regenerate all the code behind files, but no such option exists for VS 2010 and SpecFlow 1.9. I'd even be OK with programmatically regenerating them from the command line, creating another custom tool or adding a pre-compile build event.
Is there a way to regenerate all of the the Designer generated code behind files for SpecFlow features (*.feature.cs files) without right-clicking on each .feature file and clicking "Run Custom Tool"?
You can right click on the project and choose 'regenerate feature files' to do them all at once.
It runs much quicker from the command prompt. Go to your Specflow package tools folder and run the following command line. It also ensures the correct Specflow version is added to the files.
specflow.exe generateall <My_Testing.csproj>

How to temporarily exclude files from being built

My project files are controlled by Perforce and I have installed the SCC plugin so that I can work directly with Perforce inside Visual Studio 2010.
Here is the problem I have:
Inside the project, there are several files that I don't want to take into consideration while I build the project. If I use the context menu "Exclude from Project", I saw the following warning message:
Checked out items cannot be deleted by your source control provider.
If you continue with the change, you may need to manually delete
xxx.‌h in the source control database.
Is there a workaround that I can use?
Thank you
If you simply do not want them to compile, select the code file and look at the Properties window. Set Build Action to content or some other non-compile setting.

How to add/rename configurations in Visual Studio (C++) Project Wizard?

I want to generate C++ projects with Visual Studio (2005/8/10) that have more configurations other than the default "Debug" and "Release". For example, I might want to additionally generate "Debug DLL" and "Release DLL", or rename them as those.
I've generated a custom project wizard, and tried adding/renaming the configuration names in the .vcproj file (found in the custom wizard project files), in the default.js file (found in the custom wizard project files), and even in using a custom common.js file (installed with Visual Studio).
None of if works. Added configurations are simply ignored. Renamed configurations cause the project generation to fail.
Am I asking the impossible? If so, does anyone know whether it's possible to manipulate the .vcproj "on the way out" in a post wizard step?
Thanks in anticipation
Go to your solution properties.
Click "Configuration Manager..."
Under the "Active Solution Configuration" pull-down, click "<New>..." or "<Edit>..."

Integrating MSBuild into Visual Studio

I'm a solo developer running Visual Studio 2008 and looking into MSBuild to improve my build process.
Almost all of the tutorials I've found so far have plenty of information about writing a build file. However I'm having a lot of trouble finding out how to integrate MSBuild into Visual Studio. Maybe MSBuild is only used with something like CruiseControl but that's overkill for me as a single developer.
Where should the build file live in a Visual Studio project and how can I run it from within the IDE?
Visual Studio executes MSBuild automatically for projects it supports.
If you right click on a project and unload it, you can then edit it in Visual Studio. Reload (right click on project again), force a (re)build to test your changes. An alternative is to edit the project file in an external editor and Visual Studio will detect saves and offer to reload the project for you.
Sounds like you're on the right track, and if you are considering writing Targets or custom MSBuild Tasks, take the time to separate them from your current project so that you can re-use them. Don't re-invent the wheel though, the two main complementary MSBuild projects are MSBuild Community Tasks and MSBuild Extension Pack.
Update: Judging from your comment on Mitch's answer, you might also want to consider adding a new Configuration element or custom properties to a project. A new MSBuild Configuration (something other than the default Debug/Release) could run unit tests, build documentation, or whatever you want automated. A custom MSBuild property would allow you to use normal Debug/Release Configuration and extend it to automate more of your build process, just depends on what you want. Either approach could also be driven from the command line.
As others have noted, MSBuild is already available when you install Visual Studio.
If you want to integrate into VS2008: Running MSBuild from Visual Studio
MSBuild is the build engine used by Visual Studio to process the files included in a project.The Visual Studio project files themselves (**.csproj* for C#, and .vbproj for VB, for example) are in fact MSBuild scripts that are run every time you build a project.
Your .csproj file is a MSBuild file. So you are actually using it already.
You may of course wish to create a separate build file to have more control, especially within a continuous integration or nightly build say.
If you simply wish to edit your project build file then you can use the IDE to edit some settings such as pre and post build actions or edit the Xml itself by unloading project and right click and editing.
You can use your current .vcproj files to build your project with MSBuild. However, as MSBuild is not directly supported (at least for vc++) vcbuild is used instead (internally).
In VS2010 all project files are MSBuild based...
This is an older article about some simple extension points from the msbuild team
How To: Insert Custom Process at Specific Points During Build
Also, don't forget you can use the MSBuild SideKick for developing and debugging your (local) msbuilds, available for free at http://www.attrice.info/msbuild/
I'd suggest you call msbuild as a post build step. Then you can put your build script somewhere in your solution and call it.
<windowsdir>\Microsoft.NET\Framework\v3.5\MSBuild.exe c:\temp\MyProject\mybuildfile.proj
The easiest way is probably to invoke your custom build script using a post-build step. Right click project, choose "Build Events" and call msbuild with your custom msbuild file from there.
I use the msbuild template to intergrate with visual studio
http://msbuildtemplate.codeplex.com/

Resources