iis-6

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

寵の児 提交于 2019-11-29 10:49:49
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) everything works great. However, for IIS status codes (ex: 401.5, 403.4, etc), can GetHttpCode retrieve

Periodic InvalidCastException and “The server failed to resume the transaction” with Linq

半世苍凉 提交于 2019-11-29 09:45:42
I see this on our stage system, after it has been up for 2-3 days. "The server failed to resume the transaction. Desc:39000000ef." (with desc:xxx increasing every time). The stack trace shows System.Data.SqlClient.SqlException: The server failed to resume the transaction. Desc:39000000ef. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data

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

独自空忆成欢 提交于 2019-11-29 09:15:37
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 pointed my application to that I've changed the ASP.NET version to 4.0.21006 I've checked the IIS log file,

Parse errors are not displayed

泄露秘密 提交于 2019-11-29 09:09:06
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 specific problem. ANY IDEAS FOLKS? Setting error level in php file itself does not resolve the problem

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

让人想犯罪 __ 提交于 2019-11-29 07:53:17
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. 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 Members public void Dispose() { //clean-up code here. } public void Init(HttpApplication context) { // We want

IIS6: Create/install SSL self-signed cert from command line

点点圈 提交于 2019-11-29 07:21:51
问题 I want to automate the setup of SSL for a website in IIS6. It appears selfSSL and certutil can be used to do this but certificates are new to me and I'm unsure how to put them together. From what I understand I need to: create a certificate assign the certificate to the website add a secure (SSL/443) binding to the website I would also like to avoid creating a new certificate if the site cert has already been created. That way I don't end up with a bunch of redudant certs. 回答1: I would

ASP.NET routing on IIS 6

匆匆过客 提交于 2019-11-29 06:13:53
问题 I have created a basic site using ASP.NET routing according to Mike Ormond's example "Using ASP.NET routing Independent of MVC". This works fine on my local machine running the built-in web server. However, when I deploy it to my server (Windows Server 2003, IIS 6, ASP.NET 3.5 SP1) it just shows a 404 error. I have read somewhere that I am meant to set up wildcard routing. How can I do this? What other configuration changes needs to be done to make it work on my server? 回答1: You will find

How do I recycle an IIS AppPool with Powershell?

狂风中的少年 提交于 2019-11-29 05:50:27
问题 I haven't really done any Windows scripting at all, so I am at a loss on how to pull this one off. Anyway, basically what we want to do is have a script that will take an argument on which IIS AppPool to recycle. I have done some research on Google and haven't had much success on getting things to work. Here is what I am trying now: $appPoolName = $args[0] $appPool = get-wmiobject -namespace "root\MicrosoftIISv2" -class "IIsApplicationPools" Where-Object {$_.Name -eq "W3SVC/APPPOOLS/

Can I setup an IIS MIME type in .NET?

醉酒当歌 提交于 2019-11-29 04:47:24
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. 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-silverlight-app propValues.Add(newMimeType); mimeMap.CommitChanges(); } Add a reference to : 'System

ASP.NET MVC compression options in IIS6

核能气质少年 提交于 2019-11-29 04:04:19
问题 For now I'm stuck with IIS6 for ASP.NET-MVC (as in I cant upgrade to Server 2008 yet). It doesnt seem to know that my RESTful URLS are dynamic files and isn't compressing them. All my old .aspx files are compressed (as seen in Fiddler), but not the '/products/1001' type URLS. Is there any way to get IIS6 to compress my ActionResults in IIS6 without using something like an ActionFilter for compression. I'm assuming IIS7 is clever enough to know they're dynamic right. Bonus points if you can