views:

32

answers:

2

I have a bunch of ancillary XML and XSLT files that I want to edit and manage in visual studio.

The files do not logically belong under any code project in my solution and so in order to group them neatly, I have created a "dummy" C# dll project in visual studio and disabled it from building in Debug / release builds).

I wondered if there was a nicer way of achieving the same result (i.e. having all the files visible in solution explorer). What I think really want is a visual studio project type of "content only" but such a thing does not exist (or have I not looked hard enough?).

I have toyed with the idea of adding the files as solution items but then they seem harder to manage because creating a new "solution item folder" does not actually create a folder on disk.

Any one have any ideas?

A: 

Then, try creating a Blank solution. Create Empty project. Have your files in respective folders with in the solution folder. From property window, use the Show all files, include those folders into the project. There is no better solution other then this. I hope.

Avatar
Thanks for the reply - I was unaware of the blank project template but the end result is essentially the same as what I have now - i.e. an empty C# project that needs to be disabled from the build in order to prevent compiler warnings.
Chris F
I'm afraid I don't know :(. Will keep watching this along with you :). But, if those warning are only from those xml or xslt files. You can try set the build action as Resource. Since, you are not building it in either of those modes.
Avatar
A: 

A work colleague has come up with a solution.

He has suggested hand editing the project to remove the DefaultTargets from the Project (and delete a load of now unused properties).

MSBuild complains if there are no targets in the project so he has added three empty targets.

The final project looks something like this

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{541463A7-7CFA-4F62-B839-6367178B16BD}</ProjectGuid>
  </PropertyGroup>
  <ItemGroup>
    ... files ...
  </ItemGroup>
  <ItemGroup>
    ... files ...
  </ItemGroup>
  <Target Name="Build"/>
  <Target Name="Rebuild"/>
  <Target Name="Clean"/>
</Project>

Admittedly, this solution requires more fiddling that I would have liked but seems to achieve what I was after: namely a project that does not aattempt to produce any build output.

Chris F
Great to know ;)
Avatar