iis-6

ASP.NET-MVC (IIS6) Error on high traffic: Specified cast is not valid

大憨熊 提交于 2019-11-28 06:35:47
I just launched my tiny webapp on my humble dedicated server (Win2003)... running ASP.NET MVC, LINQ2SQL, SQL Express 2005, and IIS6 (setup with wildcard mapping ) The website runs smoothly 90% of the times. However, on relatively high traffic, LINQ2SQL throws the error: Specified cast is not valid This error is ONLY thrown at high traffic. I have NO IDEA how or exactly why this happens. Caching did not remove this problem entirely. Anyone seen this problem before? are there any secret SQL Server tweaking I should've done? Or at least, any ideas on how to diagnose this issue? because i'm out!

ASP.NET Session Mix-up using StateServer (SCARY!)

我们两清 提交于 2019-11-28 05:03:16
We store two objects in session. Somehow, one of the objects from another user got loaded into a different user's session. The user should have had no access to this particular data, and as soon as they saw it they knew something was very wrong. We have visual proof of the data that was presented to him, and there is certainly no way it could've happened unless the sessions got mixed up. This is a very scary situation which we can not figure out (we can not reproduce it). The only answer for us is to blame ASP.NET StateServer for mixing the session variables up, which is completely

How to secure Elmah.axd?

本秂侑毒 提交于 2019-11-28 04:38:37
We're using Elmah as our error logging system for an app that will be going into production soon. It's extremely useful, but if it goes into production like this anyone in the world access the error log because all they have to do is visit ourdomain.com/elmah.axd . This is obviously not ideal. I originally intended to restrict access to that page only to IP addresses within our company, but now our SysAdmins are saying that's not possible. So I'm asking here how can I prevent access to this resource? We running an ASP.NET MVC app on IIS 6. The typical scenario for securing elmah.axd is

How can I get the IIS substatus code from an Exception?

梦想的初衷 提交于 2019-11-28 03:58:02
问题 I'm handling exceptions with an HttpModule in a manner such as this: int errorCode = 500; HttpApplication httpApp = (HttpApplication)sender; try { if (httpApp.Server != null) { Exception ex; for (ex = httpApp.Server.GetLastError(); ex != null; ex = ex.InnerException) { try { HttpException httpEx = ex as HttpException; if (httpEx != null) errorCode = httpEx.GetHttpCode(); // ... retrieve appropriate content based on errorCode } catch { } } } For HTTP status codes (ex: 302, 404, 503, etc)

Getting a 404 when using .NET 4 on IIS 6, with or without MVC

陌路散爱 提交于 2019-11-28 02:39:03
问题 I've completed this set up on a fair few IIS 6 boxes, but one is giving me a tough time. The problem occurs when I add the application extension mapping to: c:\windows\microsoft.net\framework\v4.0.21006\aspnet_isapi.dll When this is in place, I get a 404 error on every request. Even if I remove all files from the application directory apart from a basic test.htm and navigate to that, I still get a 404. I've unchecked the "Verify that file exists" I've set up a .NET 4 application pool and

Parse errors are not displayed

无人久伴 提交于 2019-11-28 02:31:26
问题 I want PHP to display parse errors on screen. What I get instead is a blank page. Nothing gets written to server's error log file. My setup: PHP5.2.9/ IIS 6 (not Apache!). My PHP.INI: error_reporting=E_STRICT display_errors = On display_startup_errors = On log_errors = On error_log = "C:\Program Files\Zend\ZendServer\logs\php_error.log" How do I get parse or fatal errors to be either logged or shown on screen? Thanks, Temuri UPDATE : After playing with different switches it looks to be an IIS

IIS 6 how to redirect from http://example.com/* to http://www.example.com/*

孤人 提交于 2019-11-28 01:39:14
问题 I am using asp.net 3.5 and IIS 6. How can we automatically redirect pages from http(s)://example.com/* to http(s)://www.example.com/* ? thanks. 回答1: I did this with an HttpModule: namespace MySite.Classes { public class SeoModule : IHttpModule { // As this is defined in DEV and Production, I store the host domain in // the web.config: <add key="HostDomain" value="www.example.com" /> private readonly string m_Domain = WebConfigurationManager.AppSettings["HostDomain"]; #region IHttpModule

Can I setup an IIS MIME type in .NET?

怎甘沉沦 提交于 2019-11-27 22:32:33
问题 Can I setup a custom MIME type through ASP.NET or some .NET code? I need to register the Silverlight XAML and XAP MIME types in IIS 6. 回答1: To add to the master mime type list: using (DirectoryEntry mimeMap = new DirectoryEntry("IIS://Localhost/MimeMap")) { PropertyValueCollection propValues = mimeMap.Properties["MimeMap"]; IISOle.MimeMapClass newMimeType = new IISOle.MimeMapClass(); newMimeType.Extension = extension; // string - .xap newMimeType.MimeType = mimeType; // string - application/x

What Causes “Internal connection fatal errors”

二次信任 提交于 2019-11-27 21:20:20
I've got a number of ASP.Net websites (.Net v3.5) running on a server with a SQL 2000 database backend. For several months, I've been receiving seemingly random InvalidOperationExceptions with the message "Internal connection fatal error". Sometimes there's a few days in between, while other times there are multiple errors per day. The exception is not limited to one site in particular, though they share business and data access assemblies. The error seems to always be thrown from SqlClient.TdsParser.Run(). It sometimes is thrown from old-school direct SqlCommand.Execute() calls, while other

ASP.net HTTP 404 - File not found instead of MaxRequestLength exception

末鹿安然 提交于 2019-11-27 18:58:22
I have a file upload control on my webpage. The maximum request length is set to 8 MB ( maxRequestLength = 8192 ). I also have server validation that throws an error if the file is more than 4MB. The reason that its 8MB in the config is the leverage that's given to the user and also so that the application can be tested. If I upload a file that's 9MB, I get thrown an exception Maximum request length exceeded. , which is fine and working as expected. But when I try to upload a file that's 1GB, it shows me a HTTP 404 - File not found . Can someone please explain why this is happening and how can