Error when call google map static api in asp.net web application:The remote name could not be resolved:'maps.googleapis.com' - asp.net

I used google map static api to get map image, but I got an error "The remote name could not be resolved:'maps.googleapis.com'" when executing using (HttpWebResponse response = request.GetResponse() as HttpWebResponse).
But I can got image of google map in windows application(same code with web application), I don't know what happened

This thing is happen due to proxy setting in your system.Please add this code in your web.config file and it will work.
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
</defaultProxy>
</system.net>

The problem can go from invalid url (hostname) to your firewall or proxy blocking the request or even misconfigured host file or DNS.

I also faced same issue.
If you are connected with local area network and protected by Proxy server then Go in google chrome settings.
Our system takes default settings from google chrome.
In settings of chrome, go in proxy settings.Click on Lan setting.Click on proxy setting checkbox and click as well on by pass proxy server for local addresses.Also fill details of your proxy server in textbox.
Go in advance and in exceptions field type localhost.Run project again.It will work.

Related

The remote name could not be resolved: 'maps.googleapis.com'

I have an asp.net web application that uses Google Maps. Everything has been running fine for quite some time. All of a sudden yesterday, no calls to Google API would process. I assume we reached a query limit but upon checking, all quota totals were 0. I then realized we were not including our API Key in the requests. I added the appropriate API key and the maps came back online. However, I still cannot GeoCode a address using the following:
maps.googleapis.com/maps/api/geocode/xml?address=(PROPERTY-ADDRESS)&key=(OUR-KEY)
returns:
The remote name could not be resolved: 'maps.googleapis.com'
We get the same error when trying to use:
maps.googleapis.com/maps/api/distancematrix/xml?origins=(LOCATION1)&destinations=(LOCATION2)&units=imperial&key=(OUR-KEY)
However all calls to:
maps.googleapis.com/maps/api/js?key=(OUR-KEY)
work fine.
This code has worked fine for a long time, with no modifications.
We are on a dedicated server, using the same IP, However the site does run through Incapsula (Not sure if that makes a difference)
I already added:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
</defaultProxy>
</system.net>
but this did not help.
The error: The remote name could not be resolved makes it seem like a DNS issue, but the server is online and can resolve maps.googleapis.com/maps/api/js without any problem.

Trouble logging in with DotnetOpenAuth in asp.net 4.5 sample application

I am just trying to see how open auth works in asp.net 4.5 application.
I just created a new template and it has the deafult code for handling google.
I just un commented the comments as per instructions to enable it, but when i run the application and click on login, it is throwing an exception instead of redirecting to google login page
I have to cross the proxy to make the outbound requests. I guess it is what is blocking it to connect to google.
Is there any way to cross through proxy and make the request ? please suggest
If you are using a proxy then you will need to tell ASP.NET which proxy it should use - this is to do with .NET rather than DotNetOpenAuth. As mentioned by #IsThatSo have a look at Specifying a proxy to use with DotNetOpenID which details that you how you specify the proxy to use.
system.net>
<defaultProxy>
<proxy
usesystemdefault = "False"
proxyaddress="http://myproxyserver:8080"
bypassonlocal="True"
/>
<bypasslist>
<add address="[a-z]+\.mydomain\.com"/>
<add address="[a-z]+\.myotherdomain\.com"/>
</bypasslist>
</defaultProxy>
</system.net>

client constantly reconnecting

My .net application which connects to signalr hub is constantly reconnecting.
This problem only occurs on certain other corporate networks which makes me believe something is being blocked.
I've tried to use the jabbr.net website from the same network and this doesn't work either (in chrome).
How can i trace/fix this issue?
I think you're experiencing this issue https://github.com/SignalR/SignalR/pull/1553. We're working on a fix for it. The issue happens when the server sent events request times out but the actual http requests is still going. What then happens is that the longpolling transport and server sent events http requests fight for the connection.
To workaround this you can specify the LongPollingTransport specifically. We'll look at fixing this for the next release.
For your server, in your web.config's system.diagnostics section add:
<sharedListeners>
<add name="SignalR"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="signalr.log.txt" />
</sharedListeners>
For your client (I'm assuming .net C#), its logging is via Debug.Writes. Also, I'd recommend hooking into the Error handler for your connection.
If your using a JS client you can turn logging on via
// Non dynamically made connection
connection.logging = true;
// Dynamically made connection
$.connection.hub.logging = true
Hope this helps!

ELMAH File Not Accessible on Local Machine using Host Name

I can access the elmah.axd file, to view errors, when browsing using the localhost host name (i.e. http://localhost:24425/admin/elmah.axd).
I created a different host name and added it in my host file (to mirror production domain name). When I browse the site, and force an exception, the exception does get logged (SQL Server) using the prod host name. However, I am not able to view the elmah.axd file (i.e. http://www.foo.com/admin/elmah.axd). I get "HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
When I force an exception, using the localhost url, the exception still does get logged in SQL and I am able to browse this file: http://localhost:24425/admin/elmah.axd. However, I only see exceptions that occur under the localhost url (not the www.foo.com url).
After reviewing SQL, I see errors that happen using localhost with Application "/" and User set to the account I am logged in with. The errors generated when using www.foo.com have Application set to "/LM/W3SVC/6/ROOT" and the User column is blank.
I just need to be able to access the elmah.axd file when using www.foo.com/admin/elmah.axd. I have set security allowRemoteAccess to "1" in my web.config and have also added the elmah stuff to system.web and system.webServer nodes in my web.config.
I am using Windows Server 2008R2, IIS7.5 and it is a ASP.NET site (set up as a Web Application).
Thanks for any advice given.
By default elmah.axd can only be viewed on the local machine (whicj is why using localhost works).
You need to configure the web application to allow remote access.

No OpenID endpoint found

I'm trying to use the DotNetOpenAuth library to login programmatically from an aspx page. To start with, I'd like to just be able to login using a 3rd party openid provider like myopenid.
My website is an ASP .NET 4 web forms site hosted in IIS 7.5 hosted at port 9980. This port is open (inbound and outbound) in the computer's firewall.
I'm trying to use the OpenIdLogin login control but I keep getting a ProtocolException saying "No OpenID endpoint found"
I've already added this to web.config/system.net
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy autoDetect="True" usesystemdefault="True" />
</defaultProxy>
Here's the funny part, the samples themselves are working fine. Any ideas?
-Thanks!
Turn on logging and see what it says. It often gives much more detail about why no endpoints were found.
Well, I found the problem. It is an issue with the corporate firewall/proxy blocking outbound connections.

Resources