Archive for category Microsoft

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: ,

Not able to Debug Silverlight 2.0 application in Visual Studio 2008

This happens if you dont have the Silverlight Debugger Attached to the Web project in your solution.

Right Click the Web Project and go to Web tab under properties. Please check the Silverligth Debugger as shown in the Image below, you will be able to Debug

Enable Debuggin on VS 2008 for Silverlight

Enable Debuggin on VS 2008 for Silverlight

Tags:

InitializeError error #2104 in Control ’silverlightControHost’. Could not download the Silverlight Application

This exception comes due to simple reason that there are MIME Types missing for your silverlight Application which gives you following exception in your IE,

Silverlight Object Exception

Silverlight Object Exception

 

 

 

 

To reslove the same you simply need to add the MIME types to your WebSite on IIS. Select HTTP Headers Tab under the Properties. Click on MIME Types and add

   .xaml            application/xaml+xml

  .xap               application/octet-stream

You also need to enable the Content Expiration

Now your silverlight object will be loaded. If you still face problems try checking up on your permissions

Tags: