Can't reference an assembly in a T4 template

前端 未结 4 2055
孤独总比滥情好
孤独总比滥情好 2020-12-05 02:48

I have the following code in a tester class in my main assembly, PocoGenerator. This assembly is supposed to use a T4 template to generate POCO\'s based on L2S

4条回答
  •  时光说笑
    2020-12-05 03:14

    I've found there are a number of cases in creating and using the gax toolkit and packages where the build is perfectly happy with the way references are structured but the runtime gets all bothered because it can't find what it's looking for - this usually occurs when the main assembly references an assembly that uses gax elements and then that assembly in turn references another assembly that the main does not.

    try directly including the assembly in question in your main assembly - and consider that you may need to write post build instructions to move it to an 'expected' location - while a nusiance, it should beat having to hardwire the path.

    YMMV

提交回复
热议问题