且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

T4模板无法加载文件或程序集"System.Runtime,版本= 4.2.0.0"

更新时间:2023-02-24 19:09:50

我找到了System.Runtime dll错误的解决方法.

I found a workaround for the System.Runtime dll error.

将此bindingRedirect放入<configuration>-> <runtime>-> <assemblyBinding>内的C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\15.0_29f8d23a\devenv.exe.config内,其他所有bindingRedirect的

Put this bindingRedirect inside the C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\15.0_29f8d23a\devenv.exe.config inside <configuration> -> <runtime> -> <assemblyBinding> where are all the others bindingRedirect's

<dependentAssembly>
  <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly>

这是Visual Studio或T4模板引擎中的错误: https://developercommunity.visualstudio.com/content/problem/358905/filenotfoundexception-systemruntime-version4210-wh.html

It's a bug in Visual Studio or T4 Template Engine: https://developercommunity.visualstudio.com/content/problem/358905/filenotfoundexception-systemruntime-version4210-wh.html