-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to load 'ProxyAndRecordSettings' from 'appsettings.json' ? #735
Comments
@PrzemekScott
I'll investigate why I decided to use an interface instead of a class, and see if I can remove the interface. |
I see. |
Only workaround for now is to split the settings in two sections: "WireMockServerSettings": {
},
"ProxyAndRecordSettings": {
} And then do two calls:
|
I've created a preview version which only has classes for settings; no interfaces anymore. Preview version = See https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions |
Thanks @StefH. Will give it a try. |
@StefH , Yet, there is one thing which I do not understand. |
Can you provide your full project? |
Unfortunately @StefH, I've started WM project as a POC under one of test automation projects in my organisation and all of such projects are set as 'Internal', it is also bonded with our internal tools, accesses, so, unfortunately I can't share it. What we’ve checked is that colleagues working with Visual Studio IDE are not facing this “action” of opening browser when ‘Program’ is run - it's only happening when "Program" is run in my JB Rider (on macOS). |
Can you share your appsettings.json and the startup code? From that I can try to reproduce it |
Sure I can share files. |
So as it also did for my colleagues using Visual Studio. I will try to contact Jet Brain and as for some support. Maybe, just an assumption, that when JB Rider is Run(ning) web app type App, it opens it on some predefined port. But I couldn't find it in settings. Anyway, thank you StefH for help and changing interface to class in appsettings. I think we can consider this Question as closed. |
I've experimented with WM stand alone version locally, with such settings:
Now wanted to experiment with WM as web app and then set it on Azure, but not sure how to implement 'ProxyAndRecordSetting' in appsettings file. When I have it like below:

I'm getting such error:
System.InvalidOperationException: Cannot create instance of type 'WireMock.Settings.IProxyAndRecordSettings' because it is either abstract or an interface.
The way I run WM with configuration is from one of 'examples projects' :

thx
The text was updated successfully, but these errors were encountered: