【发布时间】:2013-06-28 17:54:57
【问题描述】:
我有一个使用带有 T4 模板的可移植类库的 Windows 应用商店应用程序。当我运行转换时,它失败并出现以下错误:
Compiling transformation: The type 'System.Object' is defined in an assembly
that is not referenced. You must add a reference to assembly 'System.Runtime,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
我尝试手动添加对 System.Runtime 库的引用,但收到消息“该组件已被构建系统自动引用”
在 Silverlight 项目和 Windows Phone 项目中都可以使用相同的库。
有人知道问题出在哪里吗?
我是开发 Windows 应用商店应用程序的新手,所以可能是一些小错误,但我找不到任何解决方案。
【问题讨论】:
-
很遗憾,我无法重现您的错误。也许您至少可以分享您的 T4 模板的标题部分?您是否尝试过在模板中添加对 System.Runtime 程序集的引用(通过 指令),因为模板使用的引用独立于其包含项目使用的引用。
标签: windows-store-apps t4 portable-class-library