Project file with only files and no inline output

How can I create a project file (VS 2008) that has only some data files and does not have inline output?

I can create an empty project and add my data files (which are copied to the output folder) to it, but it creates the EmptyProject.dll file after assembly. I want only my data files in the output directory, and not some empty DLL or EXE.

I want the data files to be the only ones in this project, as the project will be used in several solutions.

Our application is C #. All our usual code projects are C #.

Data files are schemas (XSD). I want these schemes to be in the output folder, but I do not want them to be included in an existing project. I need a project called Schemes that has nothing but XSD files and does nothing but copy XSD files to the output folder. I would like this to be in the project file, so that the same schema project can be referenced in several solutions.

+6
visual studio
source share
4 answers

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

del path \ filename.dll

+3
source share

Scott's answer extension:

  • Create a new project of type Empty project
  • In properties-> application, change the type of output to the class library
  • In Properties-> Build-> Advanced, change Debug Info to None
  • In properties-> assembly events, set the command line of the event after the assembly to del $(TargetPath)

Thus, the project only creates a DLL that is deleted. At the same time, the "copy to output directory" settings in your data files are respected.

+2
source share

What is a project for if you are not building it?

  • You can use solution folders to store files ...
  • Why not just turn off building this project for all configurations (use Configuration Manager) - this way it will not be created.
+1
source share

Great stuff. Expanding to Scott> Daniel's answer:

  • Safely remove all links and properties (AssemblyInfo.cs)
  • If this is a node / grunt / gulp project, you can invoke it on your command line Build Events> * Post-build event, for example: gulp build or gulp clean
  • Perhaps you can add remote or output and output folders to your clean node / grunt / gulp scripts, reducing the need for del $(TargetPath)
0
source share

All Articles