WireMock-Net / WireMock.Net

WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.
Apache License 2.0
1.35k stars 197 forks source link

WireMock standalone and Linqpad #1102

Closed asherber closed 1 month ago

asherber commented 1 month ago

Has anyone had success running WireMock as a standalone process in Linqpad?

I'm using Linqpad 7 with .net 7, and StandAloneApp.Start(args); gives me:

FileNotFoundException: Could not load file or assembly
'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Culture=neutral,
PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

I've tried playing with the "Copy all assemblies into local output folder" and "Use a non-collectible load context" settings, since those sometimes clear up issues, but no luck.

StefH commented 1 month ago

I can also confirm that for LINQPad 6, the same issue. I'm not sure yet if this is an issue for WireMock or for LINQPad.

asherber commented 1 month ago

Solution: In the Linqpad Query Properties window (F4), you need to check "Reference ASP.NET Core".

image

Maybe add a note about this to the docs?