Hello, LWhisper, you wrote: LW> All greetings! LW> prompt - in what place it is possible to thrust code generation on a template (in our case it M4) so that for this purpose it was not necessary manually the project. I for the similar know 2 variants: - Visual Studio Single-File Generators. The decision is pure Design-Time (and working especially in VS). The generator works while you in studio change a file on which "hung up" the generator. The generated file is added as child to yours (i.e. it will be a project part). A variant with a heap of lacks. For example, it is necessary to change files especially in studio, to debug difficult... - MSBuild generator (actually at this method I do not know an official title and the official description too did not see). Actually, I suggest to use the second variant. It like as explicitly enough is described here, but if in 2 words that so: - You creates MSBuild task which is able to generate to you the necessary artifacts (let it will be XMLDialogGeneratorTask in the assembly ExternalDSLSamples.dll) - for usage of this Task do special Target a file (let, for example, it is called XMLDialogGeneratorTask.targets). <Project xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"> <! - we Connect the task-> <UsingTask AssemblyFile = "ExternalDSLSamples.dll" TaskName = "XMLDialogGeneratorTask"/> <! - This main target which will be used oscillations. From important - it takes source files from Items with name XmlDialog. And the files received on an output adds to Items Compile-> <Target Name = "XMLDialogGenerator"> <XMLDialogGeneratorTask ModelFiles = "(XmlDialog)" OutFolder = "obj \$ (Configuration)" Namespace = "$ (RootNamespace)"> <Output TaskParameter = "ResultFiles" ItemName = "Compile"/> </XMLDialogGeneratorTask> </Target> <! Is it is necessary that it was possible to select from a Visual Studio for our file Build Actions with name XmlDialog-> <ItemGroup> <AvailableItemName Include = "XmlDialog"/> </ItemGroup> <! - And it we ours target in the general build process-> <PropertyGroup> <CoreCompileDependsOn> $ (CoreCompileDependsOn) ;XMLDialogGenerator</CoreCompileDependsOn> </PropertyGroup> </Project> - now, open a file of our project and we do there such changes: <Project ToolsVersion = "12.0" DefaultTargets = "Build" xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"> <! - Here something from the main project-> <! - we Add ours target-> <Import Project = ".\XMLDialogGeneratorTask.targets"/> <ItemGroup> <! - we Register our file which the generation task-> <XmlDialog Include = "DialogSample.xml"> <should ! - We specify that at change of this file it is necessary to cause ours target (at Microsoft) here often costs MSBuild:Compile, but like it it is excessive-> <Generator>MSBuild:XMLDialogGenerator</Generator> </XmlDialog> </ItemGroup> </Project> Actually, at discovery of your project the studio causes recompilation and to that we were built in build process files will be generated and get to compilation. With the assembly manually too all is clear. And here at change of templates we will work target. And yes, all navigatings on the code and IntelliSense - work (on an extreme measure should - I hope that in Roslyn they did not break it). P.S. Behind prescription of years I already could forget something - so look at article to which I refer well and as a whole look for similar decisions. P.P.S. This decision goes to a section with your initial requirements a little, namely that the generated files are not added in the project - they are connected only in build process. But it seems to me such approach more correct - the autogenerated files all the same nobody will correct (corrections will be lost at the first editing of a template), and presence such the code confuses more... Well and if it is necessary to look that enough to open a folder where we save files and to look.