ISAPI Extension gives 404 on IIS7 - iis-7

I'm running windows 7 64-bit and trying to load an ISAPI Extension I'm busy writing on my local IIS7 machine.
I added the location to the DLL under "ISAPI and CGI Restrictions"
I made the application pool recognize 32-bit applications (Extension is written in Delphi)
I made sure "Everyone" has full permissions on the directory/dll
I made sure to "Allow" ISAPI-dll in the "Handler Mappings" section and set it to "Read/Script/Execute" permissions
I still get 404.0 error in IIS7
I have checked that my MIME Mapping's is setup to handle *.dll and I have a perfectly working ISAPI-extension running on a different site on the same machine.
I even took this ISAPI-extension that gives me the 404 and put it in the root of the working website (where the other DLL is) and re-mapped the "ISAPI and CGI Restrictions" to it. Still gives me 404.0, even though I can literally run the other DLL at the same time or directly afterward and it's fine.
Any idea WTF is going on?!

It turns out when you receive a 404.0 file not found error when you've setup everything else to work correctly, it means thats the ISAPI extension you're using is referencing (ie, including) another DLL as well. Without that DLL, it will 404.0
Also, if you've forgotten to "allow" a specific ISAPI DLL (even though ISAPI/CGI is allowed to execute) the error message you'll get is 404.2 :)

I know this one's been answered but since I just ran across this yesterday, I'd also point out that 404.0 is the response you get if the application directory doesn't have Execute permission on it. It's not just for binding errors.

For 64 bit, the problem is the registry: The problem I was for 32 bit the location of apache redirector in registry is: [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]
but for 64 bitlocation must be: [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Jakarta Isapi Redirector\1.0]
Note the "Wow6432Node".
so just re-create the 32 bit on the Wow6432Node and then you are set.

Related

IIS 10.0 AppPool crashing (causing 503 error)

Situation
After the latest Windows 10 updates (Nov 2017) were installed, the Application Pool required by a local web application keeps stopping/crashing displaying the message below in Event Viewer:
The worker process for application pool 'SrvAppPoolv4.0'
encountered an error 'Cannot read configuration file ' trying to read
configuration data from file '\\?\<EMPTY>', line number '0'. The data
field contains the error code.
Setup
Windows 10
Internet Information Services (Version 10.0.16299.15)
What I've tried
I've tried a few things that I've found via Google, both here on Stackoverflow and other sites, nothing has helped so far. Some of what I've tried:
Changed the AppPool Identity to a different user (Right-click, Advanced Settings).
Checked the permissions on the machine.config (all four of them in the various \Windows\Microsoft.NET\Framework\.. and ..\Framework64\.. folders).
Unchecked the IIS and .NET features (Control Panel / Windows Features) and then added them back in again.
Uninstalled the application in question, cleared everything, then re-installed it.
Nothing has helped.
Besides reinstalling the entire machine, what else can I try?
Also, besides the Event Viewer, are there any other logs I can review to get more details? I read something about an application log, but nothing as to where to find it?
Update:
I just tried what user3739842 suggested Add/Remove Programs, selecting IIS Express and then Repair - issue remains.
Solution
For me the solution was the following (thanks rusware):
Go to the drive your IIS is installed on, eg. C:\inetpub\temp\appPools\
Delete the directory (or virtual directory) with the same name as your app pool.
Recycle/Start your app pool again.
In my case, it was a virtual directory which was corrupted.
Hi the answer to your problem can be found here. It worked for me and same error
Cannot read configuration file ' trying to read configuration data from file '\\?\<EMPTY>', line number '0'.

The page you are requesting cannot be served because of the extension configuration

Well this morning I woke up to see that my site hosted on Windows Azure was producing 50X errors and in general being incredibly slow (up to 60 seconds response time).
Now after looking through the DetailedErrors folder I see that the error received is:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I tried creating a new test website and host it and guess what? I receive the exact same error here as well.
What could be causing this?
I found this for you.
There were more errors related to local machine below these errors.I looked up the net and after some digging figured out the solution to the problem:
Run Visual Studio 2008 Command Prompt as “Administrator”.
Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
Run this command servicemodelreg –i.
for more info

ASP.NET web application can't find an assembly

I deployed an ASP.NET web application last night and I when I woke up this morning it was very slow and would occasionally just throw a 'Service Unavailable' error.
I checked the Event Viewer and it was filled up with these errors:
An unhandled exception occurred and the process was terminated.
Exception: System.Runtime.Serialization.SerializationException
Message: Unable to find assembly 'MonoTorrent, Version=0.80.0.0, Culture=neutral, PublicKeyToken=null'
I'm puzzled as it was working perfectly when I deployed it (MonoTorrent is required to retrieve the number of seeders/leechers for a certain torrent off the tracker - this was working fine), but it's no longer working and whenever code that uses MonoTorrent gets involved, the worker process just crashes.
MonoTorrent.dll is in the /bin/ directory.
UPDATE 6/4/10: I compiled the MonoTorrent source code in with the rest of my web application, but it still crashes whenever it uses MonoTorrent. However, it now says that it is Unable to find assembly 'OpenPeer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. Here, OpenPeer is the name of the web application's assembly.
This can happen in these circumstances:
The ASP.NET app creates a background thread, which throws an uncaught exception. It looks like ASP.NET catches the exception and wants to log it to the Event Log. To do this, it sends this exception from the Web app's app domain to its own app domain (the default one of the w3wp process). This needs a serialization/deserialization of the exception.
If the exception is a custom one (i.e. defined by the Web app), it cannot be deserialized in the main app domain of ASP.NET because the assembly defining the exception is typically in the Web app's bin directory, not where w3wp.exe is (c:\windows\system32\inetsrv). This causes a serialization exception and w3wp crashes.
There are possible ways to fix the issue (in a - very subjective - order of preference):
Copy the missing DLL in c:\windows\system32\inetsrv
Install the missing DLL in the GAC
Remove the cause of the exception (harder to do than to say, as we say in French)
Catch all exceptions from the background thread yourself and do the logging yourself.
Notes:
If WCF is used and the uncaught exception is FaultException, WCF swallows it and there is no crash
If the uncaught exception is in the thread of the Web request, there is a yellow screen of death, not this serialization exception
It really seems like a bug in ASP.NET
The above is actually a summary of my investigations of this issue yesterday and are only a theory. I tested fixes 1 and 4, as well as using FaultException.
Here are some things you can try..
1.) Flush ASP.Net Temp directory. Restart IIS and recycle Application pool.
2.) Make sure your web-application is running in FULL-TRUST if it really needs FULL-TRUST.
3.) Take the Assembly, try to use it in other asp.net application and run the test application on a seperate server. This might help you diagnose the problem. Also try to run the test asp.net app on the same server but in seperate application pool.
4.) Make sure the IIS website of your application is running under the user account with necessary security priviliges. Try running the application under Administratotr as user.
EDIT-1
5.) Also check if the assembly version is the same as mentioned in web.config. If there's a version mismatch then you can do AssemblyBinding Redirection in web.config.
6.) Also try registaering the Assembly in GAC and see if it loads properly.
EDIT-2
7.) Try reconfigring ASP.NET support on the server or maybe framework runtime re-setup may help. This may not be a sure-shot solution but looking at the problem condition we may want to try various solutions.
8.) Make sure you're not missing any critical update of your windows server platform.
I try to give you some ideas - what I do if I was on your position.
First of all I take a long look of the MonoTorrent.dll before some days that you make your question, and I look it again today. I found and the function that load the dll. My first opinion is that something have to do with the permissions.
I hope that you have access to the server - right ?
My first steps is that:
Ensure that your monotorrent.dll actuall have the right permissions to the bin directory, for Read, and execute by your asp.net app. Some times the copy of one dll, did not get the directory permissions buts carriage out his own permissions. To check if your dll have different permissions from the rest, just right click and see Properties | Security, then go to bin directory and do the same, and compare the Security permissions. If they are different then apply again the Directory permissions and make sure that the dll inherited by the directory.
My second step
Download the ProcessMonitor from sysinternals
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Run ProcessMonitor and try to recreate the error, stop it and analyse to see where and why the dll gets the denied permissions to run.
With the ProcessMonitor you can even see if there is any dll that can not found !
I have check the MonoTorrent dlls and I do not found anything unusual. He have kerner32.dll calls, and use unsafe code to run, ok nothing so special about.
So if you do that 2 steps and give me some feedback, maybe I can go further. (if not solve by you and what you find)
I would advice to setup Regular maintanence probably once in a week at sunday night etc for following,
Delete all temporary files
Delete all ASP.NET IIS temporary files
Restart Server
Problem is, ASP.NET web apps cause lot of temp files to be left in the disk, because of dynamic compilation of regex, seriliazation assemblies etc, such temp stuff never gets deleted, and more and more junk starts getting collected in temp locations, ASP.NET goes slower and slower, and a point comes in where disk as well as memory defragmentation reaches very high point, things start to fail.
No body likes to restart server once a week, but I remember we had no choice, in ASP.NET 1.1 we had stable system after restarting every day, in ASP.NET 2.0 onwards, we are good to have restarting scheduled at once a week.
I have found this problem and I have do all of thing as I can, such as clear temp file, restart server, delete and add reference and I also rebuild the solution. However I can't solving this problem. Finally I move my entity class (almost of them need to serialize) to new folder that I have added to the project and then this problem solved.
This method is work for me.
Try clearing the ASP.NET temp files. It's solved some odd issues before for me.
Otherwise, Fusion-logging may shed some light.
UPDATE: #Charlie - I'm not sure what to make of those logs...it looks like the failed log is from a different AppDomain. Notice the AppBase is set to "file:///c:/windows/system32/inetsrv/" and AppName is w3wp.exe.
I'm pretty sure the Event Viewer should show Application Id: LM/W3SVC/#/ROOT if it was the default AppDomain, too. At this point, all I've got is random guesses.
I notice you're running x64...does MonoTorrent perhaps require x86?
Have you double checked that the directory is an IIS application, and is configured for the correct version of ASP.NET?
Is there some other application that uses MonoTorrent on this server? Maybe a WCF service or something? I'm not sure where the Serialization is happening....
Try hooking the AssemblyResolve event and loading it manually.
Can you repro on a development machine? If not, maybe it's a borked FX install. Uninstall and reinstall.
Does restarting, recycling or stopping/starting the AppPool fix the issue temporarily, or cause the issue to appear?
You may want to type out your screenshot text too so you'll get some Google love....
Is the server timezone different than your timezone? I've had this issue when deploying resource files, the compile time was in the future so they would fail to load.
My guess that you have plenty of open but not closed connections. I mean the connections are not returned to the pool. It looks okay, when you start the application, but after some time there are only several sockets available in the pool and it goes slow. Another thing - non-closed connection may keep DLL in memory, not allowing to release the handler. Try to debug object destruction.
I know it's simple but I had this problem once and itwas because I had a Web Application project which contains
References
Folder and I just copied my files into a
Bin
folder, in any .net web application in the Project Properties windows, a Reference Path tab is available which by default should nothing be include on it. check this option and also Build tab in Project Properties window which Output path be as the same as bin\

Error while deploying setup web project of vs 2003

I am getting error as
The specified psth is unavailable.The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager
there isn't much information to go on in that message however I think it's one of two possibilities:
Your path as wrong (can you provide it?)
The folder in IIS isn't set (can you check this?)
All of which is from the error message so I'm not being very helpful, but from experience I think it's most likely to be the path so I would double check and then check again where your deploying to.
Cheers

Replicate IIS setup from one machine to another

Looked for an answer to this and didn't see it.
This is for IIS 6.0 / Windows Server 2003.
I'm working with an extremely large ASP/ASP.NET application and I'm trying to get my development environment to match my team members environment. This process is basically trial and error: get an error, go into IIS, make a change, hope the error is fixed. Ugh. I'm hoping to find a way to replicate a set of IIS directories and their configurations on one machine onto my machine.
I did find a script that will iterate through and give me a list of all virtual directories on a machine. It helped, but not a lot since I still have to go in and set up all those virtual directories (I think there are like 20 of them ballpark). The whole process is complicated by the fact that we're mixing ASP and ASP.NET applications in the same application which spans many solutions and projects. Getting the whole thing up and going seems like way too much work but I've never heard of a real solution to this.
Would Powershell be helpful here?
You should export and import IIS metabase.
These might help:
IIS Settings Replication
IIS Metabase Backup and Restore
Fortunately, in IIS7, ASP.NET config is integrated with IIS config so the job is done by copying Web.config.
Here's Microsofts' documentation for iiscnfg. iiscnfg documentation
When I ran it the first time, I got an error that said "This script does not work with WScript." If that happens to you:
1. Click OK.
2. At the "Would you like to register Cscript as your default host for VBscript?" click Yes.
3. At "Successfully registered Cscript" click OK.
4. Run the command again

Resources