Kinetic LinqPad Starter

I used to use the following to connect to E10, but since switching to Kinetic, this no longer works and I get the error about not finding System.Transactions.Local

Does anyone have a way to connect using LinqPad?

// f4 - added EntityFramework.SqlServer.dll (SERVER/ASSEMBLIES)
void Main()
	// Change query references to point to the correct Ice.Data.Model.dll and Erp.Data.910100.dll from your server directories (Press F4 or Edit the .linq file).	
	// Change this to point to your server web.config file
	var webConfigFile = @"\\xxx\E10Web\xxxApp\Server\web.config";
	// Enable for 10.2 Only
	var Db = new ErpContext();
	Db.Part.Where(p=>p.Company == "xxx" && p.TrackLots == true).Dump();

private void InitialiseConfiguration(string webConfigPath)
	// Resetting is based on
	AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", webConfigPath);
	                .GetField("s_initState", BindingFlags.NonPublic | 
	                .SetValue(null, 0);
	                .GetField("s_configSystem", BindingFlags.NonPublic | 
	                .SetValue(null, null);
	                .Where(x => x.FullName == 
	                .GetField("s_current", BindingFlags.NonPublic | 
	                .SetValue(null, null);

and additional namespace imports

This is the additional references

We’ve had similar issues when trying to do local development of BPMs.

First step is to install .NET 6 SDK, and see if that fixes it.

I installed .net sdk 6.0.406, rebooted and it’s still not working:

I’m not familiar with LinqPad, but if you are able to add references, add


I’ve added System.Transactions.Local and still get this error:

That one is in “System.Runtime.dll”

Microsoft redirecting things seems to be causing unintended side effects, but most of the time
it just works. It’s not consistent!

I have System.Runtime.dll in there. If anyone know what references I need for Kinetic in linqpad … that’s what is needed. I am missing something. Thanks!

You aren’t missing something, you are working around a problem :slight_smile:

It’s trying to pull v4.0.0.0 of the runtime which is not .NET 6.

Do you know how I get Erp.ErpContext… to look at 6 framework?

There is no .NET 6 Framework, just .NET 6 (previously core), last and final framework was 4.8.

You may not need to point to .NET 6, do you have any 4.x .NET FW installed? If not, install 4.8.

There is some mixtures in Epicor I have not been able to figure out quite yet.

No, entity framework is. net standard 2.1, that requires. Net 6

I just now seen this picture. All the .NET references you show there are
.NET Framework 4, not .NET 6.

Try referencing the 6 versions, and if you don’t need it all, pair it down to the
bare minimum for troubleshooting.

I switched them all to .net 6, still getting errors.

here is a screen shot of the errors:

i did not try .NET 6 server with linqpad, but just from looking on the screen I can tell, that you will have to rewrite this.
easy part - settings are now in host.config, not web.config
.NET (Core) does not use AppDomain at all.

Also Configuration manager was changed beween .NET Framework and .NET Core.

So probably it would be easier to start from scratch - create new .NET project and try to use ERP DataModel first, then add additional code you need.

(also, just in case, it should be linqpad 7 Using LINQPad with Entity Framework )

1 Like