Closed sparticus1701 closed 8 years ago
Looking at the AutoT4Package.RunTemplates() method, if the generated list has path information can .Distinct() be added?
Found the error was not thrown from AutoT4; I found a way to do it with include statement.
Glad you were able to sort it out. You sure the lack of a distinct on the templates is not a problem? I'll have a look into it when I get time. They don't run in parallel, so at worst it should mean that it runs the same template over and over.
In this particular case running Distinct may not do anything, since the collection is a set of objects that contain info about the context/project in addition to the template.
Okay. Will ignore for now then.
Can you explain more detail what was done there to make message box "This document is opened by another project." go away? I also using same solution. Adding same tt file as a link to multiple project expecting it to generate same version number in all solution project. But as far as I add tt to two project or more, message box "This document is opened by another project." appears.
Rather than each project linking to the same .tt file, each project has it's own .tt file containing a line like this: <#@ include file="..\ZExtra\CommonAssemblyInfo.ttinclude"#>
Thank you! It works like a charm.
I manage an internal framework which is currently has multiple projects. The version for the projects come from a single solution item called CommonAssemblyInfo.cs, which has been added as a link to each project.
I would like to add a build number to the version by using a .tt file in the same way. It would be a solution item which is added as a link in each project. I'm using AutoT4 to generate the .cs file from the .tt file at build time.
It seems to be working just fine except when I do a build I get an pop-up error "This document is opened by another project." I would guess that AutoT4 is trying to execute the template in each project that is using it, and then having a collision.
Can you tell me if that is the case and if there's anyway around it?
Using VS2015