Why am I suddenly getting "This site cannot be reached" in Chrome - c#

Everything was working fine up to yesterday. VS2019. Net.Core 2.2 C#. Today I'm getting "This site cannot be reached" As far as I know I haven't changed any settings other than a routine Windows Update. I've read a fair few articles and nothing seems to work. Even a brand new web project with no changes has the same problem.
I get the same/similar no matter what browser I point at
I'm completely stuck. Does anyone have any ideas what it could be ?

Wierd!
To fix this all I did was connect to a local SQL database (on my machine) as opposed to a remote one (external server) and then delete all the cookies related to the localhost website.
It looks like some cookies get left laying around (from the external SQL) that affect IIS somehow, for any and all sites using SSL. Monitoring cookies I get around 7 created when I use the external SQL and only 3 when using the local.
Anyway, I just deleted all those cookies (localhost) because IIS still refused to work. I don't know why and I've just lost the entire day with this issue I may investigate another time but right now I need to crack on:(

Related

Website can't connect to SQL Server, but console app can

I have a SQL Server with two databases, a production database and a development database. The .net 2.0 website hitting the production database with manual SqlConnection code is working fine. The other database is being hit from a newer ASP.NET MVC app using Entity Framework 6.2 and is getting timeout issues. The timeout takes 30 seconds the first time, but the page comes back almost instantaneously on subsequent refreshes. Both websites are on the same box as the database, so are only using "localhost" to connect. They are using SQL Server user logins, not Windows authentication.
I copied the .edmx and .tt files into a .net console app and that app has no problem hitting the database with the exact same linq query and pulling the same data that is failing.
I then created a new web site and copied just that same code into an aspx page. It fails the first time with a timeout, and then works on subsequent attempts (and a week ago, the main dev site was doing the same thing).
I separated the dev database from the SQL Server 2008 R2 server and attached it to a newly installed instance of SQL Server Express on a different port, and get the same results.
The web server is windows server 2008 standard 32-bit. I copied both websites and the console application to a new box (I thought was 2016, but it turns out it is 2008 standard 64-bit) and get the same results.
The dev site was working up until a couple of months ago. The client was using local user accounts for everything, but had a domain and wanted to do testing with windows authentication for an old vb app that hits the same database, and I had started migrating testing accounts to the domain. When the client tried to later, for an unrelated reason, change his password, we discovered that he was already using a domain account, but that his laptop could not connect to the domain. We found several other computers that could not connect, even though the machines I had connected to the domain during my testing were working fine. An outside network "friend" was brought in to figure out what was going on. At that point, I lost all track of what was actually done. I know that different network and domain configurations were tried and didn't fix the domain issues, but I don't know what. However, the production site was never rendered inoperative.
I have no idea what is going on. Does anyone else?
Oh, and in case it was a provider issue, I've also tried manual connection using OleDbconnection from the web app, and it also fails with the Timeout issue.
Update:
I spun up a new DataCenter 2016 box, installed IIS and .net on it and copied the website to that box. It has no problems hitting the database and pulling the data from the other server.
I know patches and such were updated on the original box while the domain and network were being manipulated, but I don't know how far behind they were. I suspect that some patch changed some default or inherited .net configuration options or something. I did do a "repair" on the .net installation, and that didn't make a difference. However, with the production site working fine, I'm not currently willing to uninstall .net or anything else. I'm afraid I would risk pushing this same error into the production site and the client would be screwed.
It seems that for some reason, the timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.
Try increasing the connect timeout property in your connection string to 60 or more. Default is 15 (in seconds).
Example: Data Source=(LocalDB)\v11.0;Integrated Security=True;Connect Timeout=30

System.Diagnostics.Process.Start("Notepad.exe"); is not working on live server

I'm unable to execute the following from a asp.net web application.
System.Diagnostics.Process.Start("Notepad.exe");
The project builds without errors and it works fine locally. On the live server, it just times out. I spent hours researching this online, only to find that there are others that have had the same problem. So far nothing has worked for me. Most replies seem to suggest looking at permissions. Our IT Director isn't sure how to resolve this issue either.
You probably run the web app on IIS Express locally. That means anything like opening Notepad can work, as it runs under your account in your session.
However, running on full IIS is completely a different thing, as revealed in my blog post,
https://blog.lextudio.com/2015/04/web-application-differences-in-visual-studio-and-iis/
Even if Notepad is opened in that way, it is in session 0 on IIS server side, and you cannot see it.
If you attempt to open Notepad in JavaScript at client side, you might also be forbidden to do so, as browsers run client side web apps in sandboxes, which removes access to the operating system resources.
Usually only web apps that explore the security holes in web browsers can launch Notepad by bypassing sandboxing as well as other security protection mechanism, and you probably won't be allowed to do so in a normal web app.

Asp.net Website is only accessible on our company internet connection and not from other network

I am not sure if I am posting this in the correct section?
I have released my asp.net website yesterday on our server, everything went well, I can access the website and even on my phone (connected to company WIFI). When I disconnected from the WIFI on my phone and went back to my standard network, it takes forever to load and eventually just says:
Internet could not load the web page because [website] took to long to respond. The website may be down or you may be experiencing issues with your Internet connection
This was quite strange, I then re-enabled my WIFI on my phone, and viola, I have full access to the website and all features are working. The same issue is happening when I tried to access the site from my home computer.
I am using MVC 3. SSL is enabled on the application.
I had a basic Asp.Net web application which just showed the look and feel to please the clients. That I released the same as this and I could access it anywhere from external or internal networks, so it is really strange. Am I missing a step?
The weirdest part for me is that it works at my company, but I cannot access it from out side. The IIS on the server's binding setting for this application is also set to HTTPS on port 443.
Please let me know if you require more information as I will try my best to provide it.
Thanks in advance!
So the issue was as Punit Ganshani MVP asked. The firewall at our server house only allowed http and once https was added to the list the site worked instantly.
Thanks for the suggestion. This was my first asp.net project so i just assumed that I messed something up in the code or the project itself.

CS0103: The name 'xxxx' does not exist. This randomly occurs

I have researched this quite a bit and while I can find a number of articles on the general issue and the code, unfortunately none quite like what we have.
Environment: We have 2 web servers running Windows 2012 and IIS 8. All running .net 2-4.5
Web Server 1: This is our main server that runs our main websites and web applications
Web Server 2: This runs our client websites
Code: Both sets of code are uncompiled. Both the shared code and the client websites are .NET 4 sites.
Scenario
On Web1 we have a set of website code that is shared amongst a number of client websites. On Web2 the client site is set up in IIS and a sub directory of the App_code is a virtual directory pointing to a folder in the shared code on web1. We also have another virtual folder that points to the Web1 code as well. We have over 100 websites running in this fashion for over a couple of months.
Recently a couple of our clients have contacted us to say that they are receiving an error when browsing to parts of their website that are served by these virtual directories. The file that it references in the error message is in a modules folder in the virtual directory. it is a .cs file.
It only seems to be one website at a time and if we make a change that forces IIS to 'recompile' the site (meaning that we make a slight change to the web.config, save it and then change it back and save again), the error disappears and the web site starts working correctly. When we check other sites that are in the exact same setup as the one failing, we do not get any errors and they work correctly.
We are whits end as the issue seems to be completely random. This issue has only started occurring in the last week or at least this is the first we have seen of it.
We are at the point where we believe that it might be an IIS 8 issue and something that might be occurring when it is trying to recompile a client web site but due to the randomness and the 'easy fix' it is difficult to troubleshoot or even know where to go looking for the issue.
Any help would be much appreciated.
Thanks
Don
What is the error you're having? Based on what you said, the behavior is random and points on a C# file, not much can be said and only guesses could be make...

Nod32 causing LocalHost (ASP.NET Development Server) "Connection Interrupted" Problem

I'm quoting myself on a previous question I asked to further explain:
"I'm trying to run a freshly created ASP.NET Website using C#, however when I do so it launches FireFox and attempts to connect to http://localhost:1295/WebSite1/Default.aspx (for example), but after about 10-15 seconds it displays a "Connection Interrupted - The connection to the server was reset while the page was loading." Error.
This issue is also present with older ASP.NET C# pages/Web Services I've built in the past, nothing is actually running off the ASP.NET Development server."
This is the problem that was occuring, that is before I noticed every time I ran the website, the notification for the ASP.NET Server-startup showed one port (1130 for example), and when the website failed to load; it turns out it was attempting to load the site on another port (In this case, 1128). It was suggested that an anti-virus program could have caused this kind of redirection; low and behold uninstalling Nod32 fixed the problem!
So my question is: Has anyone found a way to create an exception or remove this functionality from Nod32?
Within Nod32 enter the Advanced Setup options, and turn off protocol filtering.
It's a known problem with NOD32. Looks like it's IMON module (protocol filter) accidentally does some modifications of TCP packets that go through it.
The solution is to either turn it off, or use a different software.

Categories