You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following @lmcarreiro instructions (using machine.config instead of devenv.exe.config) I was able to get rid of the System.Runtime, Version=4.2.1.0 error, but after that I'm getting the equivalent error but this time for System.Diagnostics.Debug:
Error Running transformation: System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.Debug, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
I can "fix" it again adding another binding redirect like this:
After that, the next error I get is for System.Text.Json:
Error Running transformation: System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
which I haven't been able to fix using the previous steps. I've also tried getting the System.Text.Json nuget package (4.6.0-preview6.19259.10), but it doesn't do much and I assume the template transformation engine is looking elsewhere.
Any idea of why this issue is even happening in the first place? As far as I know, the System.Text.Json assembly should be part of NETCore.Platforms with NET Core 3.0, shouldn't it?
I already wish I didn't have to tinker with the machine.config, but at this point I'd be happy just getting this to work.
General
I'm using VS 2019 with the latest update (16.0.4), and this is my environment as per dotnet --info:
Can you either share a minimal repro or describe what is your app trying to do? Are you trying to use reflection to load or run some code in a specific assembly which targets .NET Standard? Are you running in .NET Framework?
Issue
I'm having the same issue described here: FileNotFoundException (System.Runtime, Version=4.2.1.0) when reflecting in T4 template. The issue specifically happens when trying to use Newtonsoft.Json inside a T4:
Following @lmcarreiro instructions (using
machine.config
instead ofdevenv.exe.config
) I was able to get rid of the System.Runtime, Version=4.2.1.0 error, but after that I'm getting the equivalent error but this time for System.Diagnostics.Debug:I can "fix" it again adding another binding redirect like this:
After that, the next error I get is for System.Text.Json:
which I haven't been able to fix using the previous steps. I've also tried getting the System.Text.Json nuget package (4.6.0-preview6.19259.10), but it doesn't do much and I assume the template transformation engine is looking elsewhere.
Any idea of why this issue is even happening in the first place? As far as I know, the System.Text.Json assembly should be part of NETCore.Platforms with NET Core 3.0, shouldn't it?
I already wish I didn't have to tinker with the machine.config, but at this point I'd be happy just getting this to work.
General
I'm using VS 2019 with the latest update (16.0.4), and this is my environment as per
dotnet --info
:The text was updated successfully, but these errors were encountered: