linqpad

Linqpad 7 gives CS1705 on System.Runtime


I have a console application developed using Visual Studio, targeting .NET 7.0. I have a LinqPad script in which I reference the compiled dll (so I can use the many useful classes and methods in the app). When I try to run the LinqPad query, I get the error

CS1705 Assembly 'Hub' with identity 'Hub, Version=1.1.73.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Why is LinqPad 7 using System.Runtime V6.0.0.0, and how can I fix this, please?


Solution

  • In the .NET dropdown on the toolbar, make sure that you choose .NET 7. It sounds like you're choosing .NET 6.

    Note that if it's set to Auto, LINQPad will apply the global default setting. You can change the default setting in Edit | Preferences > Query.