Archive for category Microsoft

Kill all instances of Cassini aka WebDev.WebServer.exe

I was working on a project which had many Web-Applications & Web-Services so when I debug there will be many instances of Cassini aka WebDev.WebServer.exe which was fine but I also came across a need to really kill/stop them all and doing it from system tray was real pain.

Everyone would come up with a simple solution to run a command that can kill all!

To do that I just Created a simple batch file that will kill all instances which is attached with this post. I hope that will be usefull to many.
Download KillCassini

Tags:

How to auto-restart Windows Service upon failure

Windows-service recovery from failure

Windows-service recovery from failure

If you're one of those who is administering Windows as a web-server administrator or as a windows admin and you need to take some action upon failure of your windows-service then right click on service for which you want to set recovery go to "Properties > Recovery" and choose action for First, Second and Subsequent failures of the service.

Here we have following choices:

Take No Action: Generally the default action unless modified for any non-windows service we or other programs might have created. For crucial services like web-server (apache or IIS), we usually would like to take some actions instead of doing nothing.

Restart the Service: The best option for 90% of the services which don't required restart of computer and you still want that windows-service to get started again, then choose this option.

Run a Program: I believe this option can either help you draw user's attention (as service runs in the background) by popping-up some alert message or to either writing some logs and then manually restarting that service via that program or there can be any other possibility which I don't know. Read the rest of this entry »

Tags: , , ,

Cannot load HTML template: No launch page defined in template at c:\Program Files (x86)\Microsoft Expression\Encoder 4\Templates\en\…

While trying my hands on Expression Encoder 4, I came across this issue that my template was not loading . When I checked my Activity log I found that:

Cannot load HTML template: No launch page defined in template at c:\Program  Files (x86)\Microsoft Expression\Encoder  4\Templates\en\SmoothStreamingMediaElement.
Cannot load HTML template: No  launch page defined in template at c:\Program Files (x86)\Microsoft  Expression\Encoder 4\Templates\en\PlugInMSSCtrl.
Cannot load HTML template:  No launch page defined in template at c:\Program Files (x86)\Microsoft  Expression\Encoder 4\Templates\en\OfflineShared.
Cannot load HTML template:  No launch page defined in template at c:\Program Files (x86)\Microsoft  Expression\Encoder 4\Templates\en\MediaPlayer.
Cannot load HTML template: No  launch page defined in template at c:\Program Files (x86)\Microsoft  Expression\Encoder 4\Templates\en\ExpressionPlayer.
 

The reason for this Error was due to the version change. In Expression Encoder 4 > Templates tab is separated from output tab. So simply I added the tab & selected appropriate template I wanted & the error was removed. It also created the necessary packages required

To Add the Templates Tab, simply go to Windows option and Click Templates.

Tags: , ,

Request for the permission of type ‘System.Data…’ failed

While testing one of the old samples I found that it is giving me an exceptions of permissions. The exception raised was  Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Upon checking I found that I have opened the project from a Network Drive location which as causing the permissions problem.

To resolve this you can simply take the copy of code to local drive and reopen the project.

Tags: , , ,

AG_E_PARSER_BAD_PROPERTY_VALUE

Error Reporting in Silverlight is really bad. One of the most common error you see whiled developing a Silverlight application
is AG_E_PARSER_BAD_PROPERTY_VALUE.
This error mostly occurs due to following,

Version Change in assemly while you are working in the same code (i.e. you used version x initially and later on you changed it to version x + y ). Some Assemblies in 3rd party control when upgraded do not support few older properties or methods.

Your XAML code is referring to some event which is not present in the code behind file. Make sure that all XAML code has relevant code in code behind file. (Remove any unnecessary Events from XAML and CS files)

Your XAML code has repeated the same code again, causing a clash.

Hope this helps

Tags:

The following module was built either with optimizations enabled or without debug information + Silverlight

While coding with VS 2005/2008 you may encounter with an exception that " The following module was built either with optimizations enabled or without debug information" .

To Resolve this, first thing you can do is enable full debug info on your project. to do this,

- Right Click the Project which is giving the exception and Go to Properties

- Under the Build tab go to the Advance option

- Set Debug Info to Full as shown below ,

Advance Settings

If this doesnt resolve you problem,

Please remove all the project references from your project that gives this exception.

- Remove all files from the bin folder of your project.

- If bin folder file attributes are read only , remove the read only attributes on bin folder.

- Add the existing project references again

- Rebuild the project

This should resolve your problem.

Tags: ,

Windows Terminal Server and User Auto Log-Off for RDP

If you are one who has ever faced issues due to people disconnecting from the Windows Terminal Server (RDP) and not logging off? Then here is a small change you can make and it will auto-log-off Users after specific interval of disconnection.

User > Properties > Session

User > Properties > Session

Open Local Users and Groups, select User and then right click and open Properties window. Click on Sessions tab. It will show up screen similar to one above. Change "End a disconnected session: <N>" to specific time you want after which a disconnected User Session will be logged off.

So basically this is a small trick to avoid issues while Users tends to forget to log-off their sessions.

I have faced problems in the past when maximum limit for Users to connect comes to an end and you don't have any choice but to Restart the server, even "mstsc /console" don't work..! I had such experience with one of the dedicated Windows server on 1and1.com.

Tags: ,

Paying the bills.!