so I have a problem creating a service localy, for my app as a WebJob. It seems like I read all google, but I can't find the solution. This one here doesn't count for me, because it is about authentification.
So, I have a C# console application on my pc with MANY references, ddls and lots of calculations which runs like a service. Main function, looks like this:
static void Main(string[] args)
{
string baseAddress = "http://127.0.0.1:80";
Console.WriteLine(baseAddress);
if (args.Count() > 0 && !string.IsNullOrEmpty(args[0]))
baseAddress = args[0];
SelfHostServer server = new SelfHostServer(); //using Microsoft.Owin;
server.Start(baseAddress);
}
Then I have a nodeJs application published on Azure AppService. Basicaly, I need it to call C# service and get a response with result. For this reason I am trying to create a WebJob with my C# app. I publish it and try to run it, but I get(this error is flom azure portal console) :
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: Access is denied
at System.Net.HttpListener.SetupV2Config()
at System.Net.HttpListener.Start()
at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory)
at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, IDictionary`2 properties)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create(IAppBuilder builder)
at Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer(StartContext context)
at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options)
at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options)
at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options)
at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options)
at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options)
at Avilda.Klevas.Core.Server.SelfHostServer.Start(String baseAddress)
at klevas.webapistart.Program.Main(String[] args)
It looks like it's a problem with port, but I can't find any right one anywere. I am able to run other exe's, but not the one's with who listens. I do not care if C# app will not be reachable from the outside, I just want those two to communicate. Any ideas? Or maybe other solutions(except VM)?