Add custom c# file to generated project file

Posts   
 
    
idsn11
User
Posts: 39
Joined: 06-May-2008
# Posted on: 21-Mar-2011 11:53:36   

Hi!

I've created custom task performer that generates one c#-coded file with a lot of class/enums and placed it into generated directory with root namespace.

Please tell me most simple and correct way to add my file to Generic.csproj file (Adapter template).

I know tha I can use vsnet2008ProjectFileAdapter.template but it is not suitable in my case.

Can I do this any other way (by specialized task ..) ? Or Can I do this in my generation task (best solution)?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Mar-2011 14:35:02   

The following is from the SDK Docs:

The generator object contains a cache which can be used to store temporary values, which have to be passed on between tasks. It's a generic hash table which works with key-value pairs. The property returning the hash table is called TaskCache. This cash can be useful when you want to work with data that is generated on the fly, for example the filenames of all the files that are generated. The task performers 'CodeEmitter' and 'ProjectFileCreator' use this cache for passing on all filenames of the files being generated. This way, the ProjectFileCreator task performer can include all files in the project in the project file. See the source code for these two classes for details

A similar old thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3581

idsn11
User
Posts: 39
Joined: 06-May-2008
# Posted on: 21-Mar-2011 14:42:20   

I apologize - miss this information rage

Thanks Walaa!