iis 7.5 app pool recycling has irritating behaviour - asp.net

Now I have one irritating problem. I have Site which includes many web apps on asp.net 2.0 classic app pool. My app works with the next steps:
1) I recieve login form from server, input my credentials and send form.
2) When credentials are correct, my server starts to merge all configuration settings from mashine.config and web.config to one file ApplicationConfiguration.merged.xml which located in app root folder.
3) After that my app sends me page and I continue work with site. That's all.
But.. when I start my app first time after app_pool recycling(after time out or manual recycling) I have refreshing my app immediately after writing ApplicationConfiguration.merged.xml. After that my session is expired and I login again and my app works correctly.
ApplicationConfiguration.merged.xml locates in app root folder. When I switch off writing to this file or locate its to another folder (for example temp folder in app root folder) there all works correctly.
IIS refresh my app with next event:
Application_End
ChangeInGlobalAsax
_shutDownMessage=Overwhelming Change Notification in C:\inetpub\wwwroot\my_app_root_folder
Overwhelming Change Notification in C:\inetpub\wwwroot\my_app_root_folder
Change in GLOBAL.ASAX
HostingEnvironment initiated shutdown
CONFIG change
HostingEnvironment caused shutdown
So as I understand IIS thinks that I have changed important configuration files(web.config of Glabal.asax) and refreshes my app. But I don't use this file for anything - I only write current configuration information here. And why doesn't IIS refresh app everytime when I am logging because I am writting file each time after succesfull login but IIS refresh my app only after firt start.
Can I say IIS to ingnore ApplicationConfiguration.Merged.xml changes? I believe you can help me to understand this curious IIS behaviour. Thank's for your help.

Related

IIS - Cannot create ActiveX component

I'm trying to run a COM component from my Asp.Net app on IIS server, but getting error:
Cannot create ActiveX component
So I'm calling it like that in the code, passing login on the end
gobjDaabOLE = CreateObject("Daab.Application." & DaabLogin)
Login is actually a profile name that the Daab app use.
So it all works on the local machine but when I run it through and IIS app is coming with the error.
I believe the problem is related to Daab app configuration on IIS. Every time I login to the IIS server using different credential and open Daab app it has default configuration. So I need to configure it (add location of the profile).
So now if ApplicationPool is running the app it gives me an error as there is default configuration. There is no option to globally set up the Daab app. How can I go around that? What login is Application pool using? Can I log in as that user to configure the app? Is it possible to impersonate Application pool to use one of the login already configured?
The configuration is recorded in HKEY_CURRENT_USER in registry, but nothing in HKEY_LOCAL_MACHINE. I have tried manually add it, didnt work.
Thanks for any help

Blank page when I run or debug MVC application in local machine

I'm working in MVC 5 application, and all was working well. but after time of edits and updates, I get a blank page when I try to run or debug it in my local machine.
the blank page come if I working under local IIS or IIS Express or VS development server, all return a blank page.
The response header of the request is 503 Service Unavailable
Solved:
I find the app_offline.htm file in the directory of my application which cause this behavior...
just write for who may get this later, I don't know how/when this file come there.
It may be because the application pool that contains your application is in stopped status. Restart the app pool for your application in IIS as in screenshot below.

500.19 on IIS 7, Cant log on locally

I don't know where sholud I ask this...
I've seen this issue and I think the answer should me close to that, but seems that I can't still do this.
The funny thing is the same (I think) was done by me in another server w/ IIS 7 a year ago or so, without further trouble. It could be also that I don't remember so much of it.
I have an Apache server running on port 80 (That can't be changed)
This is what I've done:
Integrated AppPool was an issue on the other server I've placed so I've tried to change the
Default AppPool to a Classic .Net
The WebApp Pool to a Classic .Net
The User is also mandatory on the Webservice so I'm placing a Service Account that impersonates for any anonymous (or not) user that might access so I have
The ServiceAccount as Administrator of wwwroot and subfolders
The ServiceAccount as Impersonated by default in the Default Web Site
The ServiceAccount as Impersonated in every Web App I need
Shared r/w the folder with the ServiceAccount
Also
I've tested the access and both Authorization & Authentication works
marvelous.
I've restarted the app, the site and the IIS multiple times without
success.
Checked the Event Log without finding anything useful.
Modified applicationHost.config getting into more troubles than solutions.
This is what I get when I try to see the App Settings at IIS7
--------------------------- Application Settings ---------------------------
There was an error while performing this
operation.
Details:
Filename:
\?\C:\Windows\system32\inetsrv\config\applicationHost.config
Line number: 165
Error: Can not log on locally to %SystemDrive%\inetpub\wwwroot as user
MyDOMAIN\MyUser with virtual directory password
--------------------------- OK ---------------------------
This is what I see when I go to my page (an asmx)
HTTP Error 500.19 - Internal Server Error The requested page cannot be
accessed because the related configuration data for the page is
invalid.
Detailed Error Information Module IIS Web Core Notification
Unknown Handler Not yet determined
Error Code 0x80070569
Config Error Can not log on locally to C:\inetpub\wwwroot as user
MyDOMAIN\MyUser with virtual directory password
Config File Unavailable (Config Isolation)
Requested URL
http://localhost:8080/myApp/MyWebService.asmx
Physical Path
Logon Method Not yet determined
Logon User Not yet determined
#Edit: 0x80070569 Drove me to see that The service account weren't logging on as a Service (as it should), nor as a Batch process.
It was a Security Setting that should be touched, a group policy object has to be set to the account (in the Example MyDOMAIN\MyUser). And that's an access that only the area of IT Security can grant.
Even when this was changed the problem remained still.
The accepted answer didn't work for me.
But when I followed the below steps, my issue was resolved:
Go to your IIS manager.
Click on Sites
Right click on Default websites, Go to Manage Website and then click on
Advanced Settings
Set your physical path credential to Specific user with credentials
Restart IIS
Note: You may also need to reenter the credentials in the application pool, if the system password has been changed recently.
It actually was a secpol.msc Policy What was blocking the web access. The ServiceAccount wasn't a Service one.
As in the edit that I posted IT Security gave me the privileges to set it a*s a Service Account*, but that alone just wouldn't do the trick.
In the Advanced Settings of the webSite
Physical Path Credentials Logon Type, Batch logonMethod was selected.
And the service account still wasn't with the privileges to run as a Batch Process.
And that was it.
Not only the service account, but also The Run as a Batch Job was necessary.
Sometimes it causes by changing administrator password or changing user access.
After that application pool cannot access to local user.
One of the most stupid solution for this problem is remove website and application pool then make another website.
This solution helped me.
Check the Password of your Application pool and application. Try clicking on the Test Settings to check the connection is proper
The accepted answer didn't work for me.
But when I followed the below steps, my issue was resolved:
1. Go to your IIS manager.
2. Click on Sites
3. Right-click on Default Web Sites and select 'Basic Settings'
4. Select Classic .NET AppPool from the Application Pool drop down
5. Save and Exit
Everything went normal.
None of the other answers solved the issue for me.
In the end, I had a re-create my site and app pool, which is far from ideal, but was the only solution that worked.
IIS must have been caching an old value that I couldn't find/clear.

How to recycle my asp.net web application in production server?

I have made changes to my global.asax file so i want to recycle my web application to make the changes work. How to safely recycle my asp.net web application in production server? Any ideas..
Just upload the new global.asax - the next time a visitor starts a new session, the app will call the new code automatically.
In IIS, you can recycle the Application Pool for your application.
In IIS 7: go into Application Pools, right-click your application's Application Pool and click 'Recycle...'.
If you're worried about not killing users' sessions, etc, then I'm not sure it's possible.
Directly upload the asax file over the server instance and it would work as expected.
A new AppDomain would be created when you upload the new global.asax file in the site and this would be used for any new requests arriving at the server and for existing requests the earlier version would remain active as lon as the session's active.

why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out.
and i debugged the website, i found no exception.
any one have ideas on this ?
Thanks in advance!
I assume the directory you are trying to delete is within the website folder.
When you delete a folder inside a website, then asp.net will restart resulting in loss of session state.
To avoid this problem
1) Try to implement out-of-process session state.
OR
2) Move the folder out of web application folder.
If you create, delete or change any directory or files underneath the web application directory while the app is running, ASP.NET unloads the appdomain thinking that the code has changed and needs to be reloaded. This clears all session state, etc. You'll need to move any file/directory create/delete/change stuff to a directory outside the web application directory.

Resources