Each time application is start using different port on every plateforn, so it's very difficult in api authentication and for CORS.
Do you want access from a external desktop application?
For internal access, you need the BridgeSettings.WebPort-Property:
string path = $"http://localhost:{BridgeSettings.WebPort}/Home/FooBar"
I Want to change AspCoreBackend port and fixed it to some static port.So Everytime it run from fix port ie,Prot : 8081
The default Port is 8000... is this not available, we search automatically the next open port to upper...
Do you need a other solution? I can add this as a feature request... otherwise all pull request are very welcome :)
Yes , I want other solution ,Can you provide a way to fixed it to some static port for all platform (eg. Windows, Mac-OS, Linux) and that port is given by me.
I've developed an app using .NET Core and Electron.NET, also developed one API in .NET Core.
When I call API from it , Its give an error about "Cross-Origin", so i need to register an IP Address and Port in that API, for that i want static port.
How much time you will take for this solution if you do this ?
Hi @GregorBiswanger , Your Answer is very important for me.please help me to solve this issue.
I think in three weeks.. sorry...
thanks @GregorBiswanger , I'll wait for this feature...
Hi @GregorBiswanger , What is the status of this Feature.
Hi @GregorBiswanger ...
Hi @GregorBiswanger , I'm still waiting for this feature.
Hi @GregorBiswanger Have you add this feature...
Hi @HirenPatelhv I have pushed a fix for this in my fork of this repo. I don't know if it will ever get picked up by the main repository though. If you want help getting it working I can do that.
@JimmyTheJ We are pretty "bad" regarding accepting PRs or answer to questions, BUT if you would like to send a PR I try to convince my buddy @GregorBiswanger to check it.
Thanks for your help!
Thanks @robertmuehsig. I put in a pull request with my changes. They also include a fix for the issue where if your assembly name is different from your executable name it won't work. I don't think the code for that fix is the most robust I've ever written though, you or @GregorBiswanger might be able to tweak it to work better.
The static port option doesn't have javascript error checking at the moment either so if the port is in use it will yell at you with some javascript errors, but until there is a really foolproof way to deal with that issue I figured I'd leave it as it indicates (at least to the developer) that you have either multiple instances of the software running still or something else is using your port.
Is the feature still needed?
Yes @GregorBiswanger , still I waiting for this feature
Hi @HirenPatelhv,
finally I have managed to implement your feature request. You now need an additional configuration in the electron.manifest.json file with the key aspCoreBackendPort:
{
"executable": "ElectronNET.WebApp",
"splashscreen": {
"imageFile": "/wwwroot/assets/img/[email protected]"
},
"singleInstance": false,
"aspCoreBackendPort": 8080, <--- Your custom Port for ASP.NET Backend
"build": {
"appId": "com.electronnetapidemos.app",
...
The application then runs automatically as a single instance. I hope you like it that way.
The feature is available with the next update 5.22.14, which will be published as soon as possible.
Most helpful comment
Hi @HirenPatelhv,
finally I have managed to implement your feature request. You now need an additional configuration in the electron.manifest.json file with the key aspCoreBackendPort:
The application then runs automatically as a single instance. I hope you like it that way.
The feature is available with the next update 5.22.14, which will be published as soon as possible.