Problems with ASP.NET State Service version; state service is 1.1, website is 3.5 - asp.net

I have a ASP.NET 3.5 website running on Windows Server 2003 and I'm using the ASP.NET State Service to manage sessions. It will appear to be working then I regularly get an error saying my code needs to have version 2.0 of the State Service running to work (I think that's what it said, I've temporarily switched back to storing sessions InProc). Refresh the page and the error goes away (for a bit, it's bound to come back).
So I looked at the properties of the ASP.NET State Service in the Services interface and it's mapping to a .exe in the 1.1 framework folder:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_state.exe
There's a corresponding version in the 2.0 framework folder, but I don't know how to add it as a new service. I'm also not sure that adding the 2.0 version (and stopping and/or removing the 1.1 version) will solve the problem.
Thanks in advance for any help anyone can provide.
Mick

I had a similar problem running ASP.net 4 side by side with ASP.net 2.0 on Win Server 2003 SP3 and all in 32bit mode.
At some stage something nuked the ASPNET_State from the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 directory but had failed to tell the ASPNET_State server that it should now be pointing to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASPNET_State.exe. I can only imagine it was when .Net 4 was installed but I can't be sure.
So I ran
sc config aspnet_state binpath= C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_state.exe
and it all seemed to work fine after that.
(Please note the space after 'binpath= ' - I fear the person who made the original post (Mick Byrne) did not put this in and thus explains why... "However this just doesn't work at all and just brings up the usage instructions for this branch of the 'sc' command" - see comments in original post)

OK, found a solution somewhere else that appears to have worked. Almost the same as the above answer:
Go to .NET2.0 directory in command prompt
run 'aspnet_regiis -i -enable'
computer sits there chewing for a minute and then it all seems to be working.
I checked the 'ASP.NET State Service' in the Services console and it's now pointing to the .NET2.0 version (not the .NET1.1).
The only strange thing I did that may have led to this scenario was to install .NET3.5 straight onto a box that previously only had .NET1.1 installed. I figured it would put .NET2.0 in along the way (which it kind of did), but must have forgotten about the session thing.

You can run aspnet_regiis -? From the framework 2.0 directory to update the web site.

Related

Classic ASP, IIS8 & VB6

I was hoping to get some people's expertise as I'm currently outside my main domain. I'm currently working for a client that has an old system written in VB6 COM Objects. They use these to do basic Database interaction. These COM Objects are used in a Classic ASP website.
I've been tasked with getting the site up, running and in a build-able environment (Windows 8.1 is what they want to use).
I've been working through all the blockers associated with this and I believe I have it in a running state (as in I've configured IIS and been able to run the website, log in and click around and so far nothing has crashed).
I can make changes to the code in Visual Studio 6 Enterprise and those changes are working so I'm confident I've got that about 90% of the way there.
I've now got 2 problems both somewhat related:
Problem 1:
Problem 1 is now debugging, both the ASP & the VB code.
I can put a break point in the VB code and 'Step-Into' it (to attach) and then run the site and the code that runs in the global.asa file gets run and hits that breakpoint no worries, can step through as I would expect.
The problem then comes when I go to 'login' to the system. I use the same user/password that works if I'm not 'attached' the system crashes with a "An unhandled exception ('Error in loading DLL') occurred in w3wp.exe [3284]." - If i try to load up a debugger from this Visual Studio 6 is not an option in the list. If I then detach and I can do everything as before.
Does anyone know what could be causing this? Or have another way to be able to debug/step through this?
Problem 2:
They had previously been 'running' the website through Visual InterDev 6.0 - they could add breakpoints to the Classic ASP code and be able to step through then into the VB components.
The problem is that although I can install InterDev on my machine, I can't actually set it up. It appears to need FrontPage Server Extensions which although they can be 'installed' on IIS 8.5 they don't seem to be officially supported by Microsoft. So I've managed to install it without any issues but it doesn't seem to be configured in the same way that InterDev needs it to be able to setup a solution file/run from it.
My Question is this: Has anyone been able to configure FrontPage Server Extensions in a way that InterDev works?
OR is there any other tools I could use to 'run' a Classic ASP site that would allow me to debug it properly.
Let me know if you need any more information.
Thanks in Advance,
Michael
I think you actually don´t need Interdev in order to debug the classic ASP code. Just create a blank solution in Visual Studio and add all the classic ASP files from the virtual directory (editor and debugging capabilities for classic ASP files are still supported, even in the latest version of Visual Studio).
I assume you run the web application in your local IIS... once you have the solution, open the script of interest, put some breakpoints and than attach the Visual Studio debugger to the web server´s worker process (which should be w3wp.exe). Maybe you need to manually select the Script code type (automatic code type detection might not work).

404.17 error - requested content appears to be script

I have a similar question to this one;
IIS 7.5
Server 2008
ASP.Net 4.0 web site
The error I get when trying to run the site is this:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
...
Most likely causes:
The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different hander.
Now here comes the weird part:
THE WEIRD PART
The weird part is that on the develop server -- which is similar in every aspect to the production server -- everything runs smoothly.
Here's a list of things I cannot try, because I don't want to mess with the sever (it hosts many other sites):
Reinstalling .Net
Reinstalling IIS
Reinstalling anything
Running aspnet_regiis
Here's what I did try:
Republishing the site
Restarting the application pool
Changing the application pool to .Net 2.0 and back to .Net 4.0
Switching around between Integrated and Classic pipeline mode
Enabling 32-bit mode
Taking a look at Handler Mappings
Eventually I created a new application pool, and it sort of started working.
Q) "Sort of"?
A) Yes, sort of.
Now the site only works when the (new) app pool is set to .Net 4.0, Integrated,
and the site's Authentication has ASP.NET Impersonation set to Disabled.
Any change to these settings sets the server yelping "404.17" all over again.
Q) What's wrong with that?
A) What's wrong with that is that I NEED ASP.NET Impersonation for the site to function properly.
As always, your guidance is most needed.
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
Usually this error occurs when you have the right IIS version installed to the respective .net framework. If it was a version (not installed) issue then you would have got a different error message. Anyways, I think by now you have resolved your matter, but I like to share some words with anyone else having this problem. These error messages gave me so much headache all last week and I had tried everything.
Best remedy is always to re install the latest .net in latest visual studio. And the important thing to do is uninstall the existing IIS(express or whichever you have) and re install it first. Then download the latest visual studio. This way visual studio installation can easily access you IIS and add the necessary application pool.
As for the error 404.17, it could simply be because the right application pool has not been assigned for the appropriate dot net version. If the right version is not there re installing visual studio is the only way I know. Also, I think you can try downloading another version of the Visual Studio too. For eg, download the ultimate if you have professional or vice versa. Hope this helps someone with similar problem.
Installing this windows server feature http activation is, what was missing for me.

Debugging ASP.NET in IIS 7

I have searched all the usual but come up empty. I must be doing something silly!
Simply I created a new project, ASP.NET Web App, and wish to use and debug it with the local install of IIS 7.5 on my Windows 7 x64 box.
According to what I have read it should be a simple process; my issue is that Visual Studio will not stop at breakpoints nor at errors etc.
I just don't get it:
Visual Studio is attaching to the w3p process for me automatically.
If I hover over the breakpoints it shows a message saying the same, that it is in the same w3p process.
I am in Administrator context. I manually ran it like so to be sure but in any case if you are an admin it runs like that anyway.
Some notes:
I do not wish to use IIS Express as I require native IIS 7.5 for my tasks, however it does debug in express - no surprise there.
As mentioned above, all this is being done locally.
The path of the virtual directory is pointed towards the project files, as set by Visual Studio 2010. It even set the Network Service as read on the folder structure.
When debugging from VS the web site runs fine, just debugging is the issue.
Maybe it is permissions? The Default App Pool is using the ApplicationPoolIdentity not Network Service... Should it be? I had assumed they we.re one and the same essentially. Although I changed this and no luck unless I didn't do something I should of
Keep in mind here that my issue is semi-unique in that I am not receiving error messages, not even in the event logs... For all intents and purposes it should be working fine, just it isn't.
VS and IIS, and all updates, are applied to date.
Note: I'm familiar with IIS7.5, I run my own public web hosting server. I just never tried to debug
Note: It is Visual Studio 2010 Ultimate
Thanks for your time.
Sigh!
I went back to basics... Uninstalled IISExpress and tested; It worked! Re-installed IISExpress; It worked!.
I guess installing IIS7 native after IISExpress did something screwy? I had ran the register ISS command on IIS7 when I installed it.
Right, so now I have both installed in tandem and they work fine. Thanks for all your help guys, appreciated.
you can try right-click on project in VS go to properties select web from left menu tab. Check if ASP.NET debugger is checked and also you can select Use Local IIS Server and give localhost url there (in project Url textbox) and then Say start debugging from VS and put breakpoints.
I had a similar issue the other day, I attached the debugger to the wrong w3p process, make sure you attach it to the one the app pool identity is running under.
I wanted to write it as comment by I don't think I can add pictures..
Are you sure you are running the same version of dll?
Is your breakpoint filled like this?
or hollow like this?
1st go to ,Program and Feature in control panel and then in that turn on or off windows features. and now check all check boxes(activate features) related to Internet Information server & windows service managers. once this is done run your visual studio as administrator and then attach to right w3p process.

Visual Studio .NET has detected that the specified Web server is not running ASP.NET 1.1

ok, I'm stumped.. yes, I've googled already and this time, it seems it is the first time that google failed me.
I have an ASP .Net Web Application project (acquired from a predecessor who loves brute algorithms and redundancies in his codes) and was trying to open it in a VS .NET 2003 where it was developed (well, actually not on the same machine where it was developed.) The project is a part of a larger solution composed of other VB projects. When I first opened the inherited solution some era ago, I found that an error prevented me from opening the said web project... I just ignore it then because the project wasn't that important before. Now that the project needs to be maintained, I think it's time for me to get my hands dirty with it.
This is my first time opening a web application project so I expected that there will be something wrong:
Visual Studio .NET has detected that the specified Web server is not running ASP.NET 1.1. You will be unable to run ASP.NET Web applications or services.
Right. With the use of a trusty Google, I have tried my efforts on the following (but as I have said, this time, she failed me):
Uninstall .NET framework 1.1
Reinstall .Net framework 1.1
Followed KB 306005 which says about: aspnet_regiis.exe -i
Tried the switches -u, -ua, -c and -enable for aspnet_regiis.exe
Restarted IIS
Deleted the folder for framework 1.0
rebooting and/or retrying between the items above, but I still get the same error.
There's another thing I tried, changing the path of the project in the .sln file using notepad. I changed the word "localhost" to my IP address but it produced another error saying that it can't open the project and that the web does not exist.. it asked me to try another file share path. No joy there.
I noticed that by accessing the address http://192.168.2.138/MyWebProject/main.aspx in a browser, the web page looks ok (that's my IP, btw). But the http://localhost/MyWebProject/main.aspx doesn't work and gives the message: No web site is configured at this address.
I'm using XPProSP3 with updates of Oct 2010; I have .Net Framework 2.0 SP2, 3.0 SP2, 3.5 SP1 installed together with 1.1; Latest SP for 1.1 is KB979906.
I think that I'm just missing something that needs to do before making a ASP .Net web project.. :D
I like to open the project in my VS but I'm stumped. How can I open it?
I knew I am missing something above. I was able to pass through the error today by doing the following:
Uninstalled IIS 5.1
Reboot
Reinstalled IIS 5.1
Do aspnet_regiis -i of the installed version 1.1.4322
Reboot
Tried making a new ASP.NET web app and I was able to make one.
Tried opening the file in my post above and it gave a new error:
Unable to get the project file from the web server.
Well, that's a new error for me, another story and I think there's no point of continuing this thread because the title says so. I have to move on and continue to discover how to open this file. ;)
Good day.
Change the webside address to nothing or add localhost to it (in site properties in IIS). Alternatively in project properties switch to builtin asp.net webserver.
If you can visit the site on one URL, but not another (and both point to the same computer) then most likely it is a problem with the web server configuration. Both hostnames are not bound to that solution/folder. It CAN be a firewall issue. Try temporarily disabling the local firewall.
The access logs from IIS and the Event Log are valuable resources in troubleshooting such issues.

Script not served by static file handler on IIS7.5

I've just tried to deploy my first web application to IIS on my Windows 7 Home Premium notebook. After creating the application, I had to change to the Classic App Pool, then set that pool for framework 4.0. Now I get the following error:
HTTP Error 404.17 - Not Found The requested content appears to be
script and will not be served by the static file handler.
The requested URL is http://localhost:80/pvmms/default.aspx
I'm afraid extensive Googling has yielded nothing clear or definite enough for me to work with and as usual I've turned to the experts.
EDIT:
I suspect this is because there are no framework 4.0 handler mappings for .aspx files. However, aspnet_regiis even gives my admin user the finger and says I need admin rights to run it.
EDIT #2:
I registered all the frameworks (2 & 4, 32 and 64) and all now works. I found this by manually adding a script map for .aspx to aspnet_isapi and voila. I don't understand why the installation of the framework doesn't do this, unless my memory fails me and I only enabled IIS after installing VS.
Maybe too late now, but more often than not you need to run
aspnet_regiis.exe -i
after installing asp.net. Maybe I would do it anyway now.
In addition to above, if you need WCF support, you might need to run this:
c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -i
Replace v3.0 to whatever your current framework version is.
I encountered this error from IIS 8.5 when trying to access a WCF service I had written. Turns out the server didn't have the WCF HTTP Activation features turned on. Checked the boxes and clicked through the wizard, iisreset, started working.
If you are using iis 7.5.
Just go to IIS Manager, open your website properties.
You will see 'Handler Mappings' section there, just go to that section and Search for 'staticFile'.
Most probably its a last file in the list.
Then Right Click on it and Select 'Revert To Parent'.
I have wasted so many hours while i have faced this first time, anyways this will solve your problem.
I had this issue with Windows Server 2012 with ASP .NET 4.5 you can't use aspnet_regiis.exe, and just have to install ASP .NET 4.5 via the Add Roles and Features Wizard:
You can find the menu item "Add Roles and Features" in the menu "Manage", in the right corner of Server Manager
should check out this option i suppose
I solved this problem by enabling WCF Services
Programs and Features > NET Framework 4.5 Services > WCF Services> HTTP Activation node
But you have to admit it guys this ENTIRE IIS setup configure/guess/trial and see/try this/try that spends 4 or 5 of our days trying to find a solution around approach IS A COMPLETE AND UTTER JOKE.
SURELY, 'IIS' IS THE BIGGEST CONFIDENCE TRICK EVER PLAYED ON MANKIND TO DATE
I know this is an old question, but I've just had this with a 3.5 application on my rebuilt Windows 8 machine and I was still getting this after aspnet_regiis -iru and it turned out the be ASP.NET 3.5 wasn't ticked within Application Development Features (not enough reputation to post an image).
There is a chance that application pool created for you application by default is version 2. So although you see a handler for .svc extension in the list it does not work and treat it as static file. All you need is to open application pool properties and switch it to version 4.
Register asp.net again....will solve the issue.
Go to Visual Studio Command Prompt, And register asp.net as windows\microsoft.net\Framework[.Net version num]\aspnet_regiis.exe -i
I had this same issue on a windows 8 machine I am setting up. I had installed vs2012 before vs2010, which installs .NET framework 4.5. I have my app pools running in 4.0. I made sure I had aspnet registered for 4.0 using aspnet_regiis -i. That still didn't do the trick. Then I opened up the Windows Features and noticed that 4.5 added a set called ".NET Framework 4.5 Advanced Services". I enabled the WCF Service node and its children and then my svc endpoint operated correctly. Hope this helps folks who are making the move to Windows 8.
I stumbled upon this question when I ran into the same issue. The root cause of my issue was an incorrectly-configured app pool. It was set for 2.0 inadvertently, when it needed to be set to 4.0. The answer at the following link helped me uncover this issue: http://forums.iis.net/t/1160143.aspx
For Windows 10/Framework 4.7, I had to turn on HTTP Activation through the following method:
Control Panel > Programs and Features > Turn Windows Features on or off
Under .NET Framework 4.7 Advanced Services, expand WCF Services, select to check the HTTP Activation and whatever else you need when working with WCF
Click OK and let the install do its thing, then open an administrative command prompt and issue the IISRESET command
cmd -> right click -> Run as administrator
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
For other people reading this:
This can happen is if the .Net version that you have registered isn't the one selected under the 'Basic Settings' of the application pool attached to your website. For instance, your sites application pool has .Net v2.0 selected but you registered v4.0
Just another possible solution I found having the same error message.
When trying to setup a .NET 4.0 web application to a new applicition pool I was receiving this strange error telling me it was trying to process my aspx file with the static file handler, which didn't make sense.
For some reason the ISAPI for .NET 4.0 was set to disabled in the ISAPI and CGI Restrictions area of the server level in the IIS manager. Setting it to enabled was all that was required, however the IIS 7.5 manager is so convoluted and hard to follow it took me a long time to figure this out.
I'm guessing that since it was a 4.0 Application that could not be processed by the 4.0 Engine the static file handler was being used by default.
I had the same problem. When I added Static content feaute for IIS, It works fine.
it could be multiple reason, in my case under Application pool->advance setting->Enable 32 bit application (should be true).It was set to false before.
Using IIS manager, I found that .aspx files were mapped (under "Handler Mappings") to ISAPI 2.0 - even though ASP.NET 4.5 had been previously installed. Editing them to point (also) to an executable for ISAPI 4.0 64bit fixed the issue.
The executable was found in
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
i received this message for an application on iis 7.5 with a classic app pool assigned to .net 2.0. i needed to go to Handler Mappings and add two script maps, both were the same with except for the name. one name was svc-ISAPI-2.0-64, the other was svc-ISAPI-2.0. The request path was .svc. And the Executable was %SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll. i restarted iis and all was happy
One of the worst case scenario I just solved is - having conflicting entry in Web.config.
On my local machine I didn't had .woff extension registered in IIS, so I added it using Web.config. But on production server .woff had mime type registered. This caused application level conflict.
Funny part is there are no error logged for this. Just a guess work (first time of course).
So for me solution was just to remove and/or elements from web.config.
I had the same issue, I just changed the target framework version on the website to the version it is developed in,Same in IIS. This solved my problem. Hope this helps...
Thank You

Resources