# [.net] Multiple solutions in dotnet prebuild

This topic is 3596 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Anyone here familiar with dotnet prebuild? I want to be able to have it create multiple solutions and have some projects shared between solutions. Is there any way to do that without duplicating the <project /> section in Prebuild.xml for each solution that includes the same project?

##### Share on other sites
Been a while since I looked at prebuild, but you might be able to do something with changing the path of the <Project> node to go up a level, but I don't think there is specific code for including another XML file into one file (though, Preprocessor.cs is where you would do that).

##### Share on other sites
So, you are saying the way to do it is to modify the source of dnpb?

##### Share on other sites
Most of my work on prebuild was with the nant building and some processing instruction stuff. There isn't explictly a <?link?> PI or something like that from what I remember, nor an xlink. So, unless I missed something browsing the code again, you'll have to make some changes to include.

I would go with either a <?PI?> or a xlink version, if you want to add it. And I'm sure someone will appreciate it if you do, mainly because its a useful feature.

I could be wrong though, I just didn't see anything when I went through the subversion repository.

##### Share on other sites
I thought about adding onto it but it looks like from the forums that the project is not very active. But then I notice that you are one of the developers so maybe I don't have to be as concerned about trying to make a submission to a project that none of the developers are paying attention to.

Well, if I don't get that far I may just create a preprocessing utility to generate dnpb files the way I want.

Edit: Actually it was easy to add support for an include node in dnpb. I will test it some more and then submit a patch.

[Edited by - kanato on November 18, 2008 2:55:25 PM]

##### Share on other sites
Ok, I created a patch which add support for include files in a prebuild.xml file. To use it, one adds a preprocessor command like:

<?include file="some_other_file.xml" ?>

Please let me know what you think.

##### Share on other sites
Sweet, I'll look at it tonight when I get home (meant to do it yesterday, but got distracted with avoiding homework). :)

##### Share on other sites
Cool. I found some other issues with making visual studio project files. Designer generated files and resx files aren't linked with Forms and UserControls correctly. I've fixed some of those issues myself, but I don't have quite the understanding of the whole code well enough to know if the fixes I've done are the way they should be.

##### Share on other sites
So, this is an issue that I've been struggling with and I have had to fix several parts of the prebuild code to get this to work. First I have to ask the question, if I have a WinForms app where I have a settings file and resx files that are associatd with UserControls or Forms, what is the proper way to write my prebuild file so that these are included? This is the sort of approach I've been trying to use:
  <Files>    <File buildAction="None">Properties/Settings.settings</File>    <Match pattern="*.cs" recurse="true"/>    <Match pattern="*.resx" recurse="true"/>  </Files>

When creating VS2008 project files though, the resx files are not correctly marked as dependent on any associated forms (for instance, if a form has an embedded icon). If the match line for resx files is left off, the resx files are not included in the project and not compiled.

When creating nant build files, the above approach causes resx files to be included as resources, and then again as source files, which causes the build to fail when nant is run.

So if I'm using Prebuild wrong, I need to understand how to setup a basic winforms application with a settings file and resx files which may or may not be attached to a form or usercontrol. Otherwise, I can submit patches for these issues to correct the output for VS2008 and nant. (I've checked in my fixes for Prebuild to the AgateLib SVN on source forge, if you want to take a look. I am not yet satisfied with my testing to submit as a patch, but if you want to give me preemptive feedback on it, feel free to take a look.)

##### Share on other sites
I remember encountering the same problem with the VS2005 target. This was fixed at some point, but I'm not sure how.

In OpenTK, I simply include the .cs files and prebuild automatically handles the dependent resources.

1. 1
Rutin
25
2. 2
3. 3
4. 4
5. 5

• 9
• 10
• 13
• 19
• 14
• ### Forum Statistics

• Total Topics
632944
• Total Posts
3009356
• ### Who's Online (See full list)

There are no registered users currently online

×