Cannot assign requested address on dockerized services on windows - windows

I need help.
I am getting SocketException: Cannot assign requested address. It happens when i try to access serviceA by serviceB via Refit. If run one of the services on IIS or in Visual studio debugger everything works fine. But when i run them both in docker containers, system throw that error.
It also happens when use Ocelot. If the gateway service is on IIS or run in debugger (separate from other services) it works, but when I put it in container with the other services i get the error.
What could it be?
WIN 10
VS 2019/VS Code
Docker desktop
WEB API CORE 3
Refit - https://github.com/reactiveui/refit
Ocelot - https://github.com/ThreeMammals/Ocelot
Thank you

Related

Deploy Outlook Add-in on an AWS EC2 instance

We are trying to host a custom Outlook Add-in on an AWS EC2 instance. We are using a windows server in EC2 to host this. Currently we are using webpack dev server to host it locally and everything is working fine. Now we need to deploy and have this app run as a service in the Windows Server.
We have tried to deploy the build on an IIS server. But we were not able to proceed after logging in to the application. We are getting the error as a Bad request. We also have tried to deploy it on Apache server using XAMP. But the results were the same. It is getting deployed in the webservers, however when we are hitting the backend application it seems to be erroring out.
The error we are getting is Error: redirect_uri_mismatch, when we try to authenticate and redirect to the authenticated home page of the application.
When we deploy the same using webpack-dev-server in the instance, It is working as indented.
We are facing issue to identify the proper reason for this error and unable to deploy the service in EC2.
EDIT
Screenshoot-1
Screenshot-2

Access to a self-hosted WCF service on azure virtual machine over the Internet

Actually the question is kind of duplication of the following one Unable to access a locally hosted wcf service over the internet but with only difference that the service is hosted by a windows service on Azure Virtual Machine.
I can access the service on the machine and I have added an endpoint to the service port at Azure Configuration console, but still cannot access the service over the Internet.
The error message that is not possible to set up connection.
Is my scenario technical possible on azure? if yes - what is done wrong?
The answer to my question was pretty straightforward. Although I opened my endpoint in Azure Management Console the port was blocked by the virtual machine firewall (windows firewall). After setting in- and out- tcp port rule, the problem had gone.

Work with Web API and Windows Phone

I am developing a solution that is composed of two elements: a web server, which publishes some REST services, and a mobile client, which consumes those services.
To implement the REST services I have used the Web API technology.
When I start the web project in debug, everything works fine. I can use the services by pointing to localhost:63954/api. A weird fact: if I change "localhost" with "127.0.0.1" or with the LAN address of the machine, 192.168.xxx.xxx, the server does not answer anymore!
Then, when I start the Windows Phone client, which runs in a virtualized emulator, it fails to connect to the web server! Even if the two components are running in the same machine.
Obviously, in Windows Phone I cannot use the "localhost", since the localhost of the phone is the phone itself. So I'm trying to use the 192.168.xxx.xxx address which is the address of the machine that is running the web service. But the mobile phone emulator fails to reach the webservice.
I need to run the Web Server in Visual Studio 2012, since I need to debug it, and to make it reachable from the Windows Phone Emulator, but I do not know how to do it. Can you help me? Any idea?
Thank you so much,
Riccardo.
EDIT: By following the link found here (Binding IIS Express to an IP Address) and by turning off my firewall I can run the web application outside VS12 and I can make it reachable from other pc in the network, and so also from the WP emulator. This could be a work-around, but I cannot debug the REST service in VS in this way and this is not good...
The Windows Phone 8 emulator works as a separate machine on your network, with it's own IP address and configuration. Therefore, for the emulator to be able to access your service you will need to make sure that the port you are trying to access is open for inbound connections.
As you mentioned the windows phone is running seprate in your client machine,One way of solving this problem is ,Binding your machine's Ip address to the Web Api,SO the Web api can be accessed using the Machine's Ip address.You can Bind the ip address to the project by using Microsoft Webmatrix.
So,You can access the web Api using the Ip address.Hope this helps.

webrole dev fabric browser launch url instead of IP

When I debug/run a webrole in the dev fabric, it launches a browser instance that goes to the loopback address(http://127.0.0.1/). This is the normal visual studio behavior for debugging a webrole/cloud project.
Is there a way to get the debug/run command in visual studio to have it launch the webrole with an actual hostname like dev.whatever.com, instead of 127.0.0.1
(I have dev.whatever.com as an entry locally in my hosts file. When I manually paste that into the browser, it works fine, and I can debug my webrole project without issue. Just trying to see if I can cut a few clicks out of my code/debug cycle).
When Windows Azure applications runs in compute emulator, the architecture is to launch the
application and map the application endpoint with IP address and Ports (In case of multiple instances) to emulate the loadbalancer behavior.
As you were able to change the mapped IP address to a desired IP address however I don't think it is possible to map endpoint to a specific hostname in compute emulator.

WCF Service throwing error in WCF Service Host

I'm having some trouble with a WCF Service. When I host it in IIS, it runs fine, but I figure there is a problem somewhere.
When I run my WCF Service in Visual Studio 2010, it brings up the WCF Service Host.
It names the host, then the status is 'Error'.
The error it gave is this:
System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL http://+:8732/Design_Time_Addresses/EvalServiceLibrary/Service1/. Another application has already registered this URL with HTTP.SYS. ---> System.Net.HttpListenerException: Failed to listen on prefix 'http://+:8732/Design_Time_Addresses/EvalServiceLibrary/Service1/' because it conflicts with an existing registration on the machine.
I don't know if this has affected the service deployed in IIS, since that tells me I have created a service if I browse it through IIS.
Any ideas?
It's pretty clear, the address is already in use.
Does the service in IIS run on the same port? Change it, or change your port for the development.

Resources