Tips and Tricks in a world of Mix

Posts tagged ‘iis’

Setting constant parameter in WebAPI

So the mission was to set static member for connectionString , so that we’ll get the string from web.config just once. On the way we did Encrypt and Decrypt of the connectionString.

So the trouble was that we couldn’t be sure that the static field is staying or going on the request- response model of WebApi.

The easy solution was to reuse the existing code to init HttpContext.Current.Application[“connectionString”] value if it’s null at the global.asax at Application_Start function.

When initialized in that function at the host/server side of the distributed system , the HttpContext.Current.Application[“connectionString”] is initialized for the first time and until the IISReset.

If you want something constant for one request the way to go is to put it in Init function at gobal.asax 

The trouble was that the Application variable has been resetting itself each request.

The solution was that because of decryption that has been saving the web.config it has been resetting the site values held by the IIS, so actually it has been recycling the site data resetting the Application variables values also.

At the end the encryption has been executed on publish to the server, the decrypt has been decrypting the secured section but hasn’t been saving it back , so the web.config actually haven’t changed throughout running host , so the Application data kept intact.

Advertisements

The (SAMAccountName=) search filter is invalid

Starting a website got this error.

Untitled4

 

It means that Authentication level in IIS is not the right one .

It also means that probably you didn’t add all the needed features to IIS.

go to :

Start –> Control Panel –> Programs –>

(more…)

The web server process that was being debugged has been terminated

OS: Windows 7

IIS : 7.5

When you are starting to fall every 1.5 minute with a message

“The web server process that was being debugged has been terminated by Internet Information Services (IIS).  This can be avoided by configuring Application Pool ping settings in IIS.  See help for further details.”

 

It means that you need to configure the App Pool:

run –> inetmgr –> enter –> click on App Pool  -> right-click on App –> set Application Pool Defaults –> just change everything with (seconds) to 900 instead of 90.

 

 

image

It works!

Tag Cloud

%d bloggers like this: