I have a solution that has a few projects in it. I'd like to create some T4 templates in one of my test projects to generate tests based on code in another project. The test project has a Project Reference to the other project. The problem I have is that I don't know how to get a file path to the edmx file I need to generate code from.
Example (pretend this is an ASCII-based Solution Explorer):
MySolution.sln
-> MyTests.csproj (C:ac)
----> GeneratedTests.tt (C:acGeneratedTests.tt)
-> MyDAL.csproj (C:xyz)
----> MyModel.edmx (C:xyzMyModel.edmx)
How would my GeneratedTests.tt be able to get a file path for MyModel.edmx utilizing its project reference to it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…