Reputation: 1390
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.
Upvotes: 11
Views: 5133
Reputation: 1402
Possibly another way is editing the csproj file by replacing this:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
with this:
<Target Name="Build" />
<Target Name="Rebuild" />
Then builds don't create anything. It worked for me.
Same general idea should work for any xxproj file. Just replace the <Import Project...>
tags with the <Target...>
tags.
I'd be interested in knowing if this causes any issues or doesn't work for anyone.
Upvotes: 2
Reputation: 492
Great stuff. Expanding on Scott > Daniel's answer:
gulp build
or gulp clean
del $(TargetPath)
Upvotes: 0
Reputation: 17648
Expanding on Scott's answer:
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.
Upvotes: 3
Reputation: 664
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
Upvotes: 4
Reputation: 75983
What do you need a project for if you're not building it?
Upvotes: 0