Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project file with just files and no built output

How can I make a project file (VS 2008) that just has some data files in and has no built output?

I can make an empty project and add my data files to it (which get copied to the output folder ), but it produces an EmptyProject.dll after I do a build. I want just my data files in the output directory and not some empty DLL or EXE.

I want the data files to be the only thing in this project as the project will be shared in a couple of solutions.

Our application is C#. All of our normal code projects are C#.

The data files are schemas (XSD). I want these schemas to be in the output folder, but I don't want them included with an existing project. I would like a project named "Schemas" that has nothing in except the XSD files and does nothing except copy the XSD files to the output folder. I would like this in a project file so that the same schemas project can be referenced in multiple solutions.

like image 378
NascarEd Avatar asked Jun 01 '09 17:06

NascarEd


2 Answers

I don't know of a way to suppress the creation of the .dll file. BUT... here's an easy workaround. In the project properties, Build Events tab, write a Post-build event command line that will delete the file. Something like:

del path\filename.dll

like image 130
Scott Ewers Avatar answered Sep 28 '22 05:09

Scott Ewers


Expanding on Scott's answer:

  1. Create a new project of type Empty project
  2. In Properties->Application, change Output type to Class Library
  3. In Properties->Build->Advanced, change Debug Info to None
  4. In Properties->Build Events, set the Post-build event command line to del $(TargetPath)

That way, the project creates only a DLL, which gets deleted. At the same time, the "copy to output directory" settings on your data files is respected.

like image 45
Daniel Rose Avatar answered Sep 28 '22 06:09

Daniel Rose