Skip to main content

Posts

The Project Location is Not Trusted Dialog Box

Often due to backup issues, our desktop profile is setup to store all profile details (including documents) on  a share location. The benefit of this is two fold 1. It gives you roaming profile. You can logic from any desktop or even remotely, and you have access to all your personal documents 2. All your personal documents are backed up on a shared server. So if your desktop crashes or your laptop is stolen, still you have all your documents on the shared server. However as a developer using Visual Studio to develop web application, this presents some problems. By default the security policy on windows doesn't trust the files on a network share. So when you create or open a project from your My Documents/My Projects folder, Visual studio shows "The Project Location is Not Trusted" Dialog Box. Even worse if you try to debug the web application stored on a network share, you get an exception "An error occurred loading a configuration file: Failed to start monit...

No SQL Databases

Recentely there has been lot of discussion about No SQL databases. Some see it as alternate to SQL database which means writing no SQL to query the database Hence No SQL. Another camp is opinion it is 'Not Only SQL' which basically means you can query the database in more than one way. These databases are also know as Document Databases as the data is stored as Documents (serialised as JSON objects) . There are three main leading open source Document databases MongoDB - http://www.mongodb.org / RavenDB - http://ravendb.net/ CouchDB - http://couchdb.apache.org/ Update: fourth contender, Amazon Simple DB : http://aws.amazon.com/simpledb/ RavenDB and CouchDB stores data as JSON objects while MongoDB uses a twist and stored data as Binary JSON (BSON) objects. Mostly the data is queries either through RestFUL API's using HTTP or through TCP/IP. These databases also support Indexes and Transactions. For transaction critical applications like banking or realtime syst...

Difference between XML Serialization and Binary Serialization

XML Serialization Binary Serialization (Soap) No need of Serializable attribute on the class Need Serializable attribute Only public members are serialized All members are serializes unless specified as NonSerializable Class should have default public constructor and class itself should have public access. No need of default constructor or public access Namespace: System.XML,Serialization Namespace: System.Runtime.Serialization.Formatteres.Binary (.Soap) Outputfile is XML Outputfile is Binary or XML for SOAP formatter XMLSerializer need type of object to be serialized or deserialized No need to specify type of object to be serialized or deserialized. Support only IDesrializationCallback interface. No support for binary events. Binaryformatter support binary events. Soap formatter supports only IDeserializationCallback interface

Searching Unicode characters in Oracle table

Oracle implementation of Regular expression has no support for using hexadecimal code to search for Unicode characters. The only way to search for Unicode character is it use the character itself. Normally with Regular expression, you can use \x or \u followed by hexadecimal code to search for any character. E.g. \x20 will match space. But REGEXP_LIKE in Oracle does not support \x. You need to use unistr function to convert the code to equivalent character and then use it with REGEXP_LIKE. E.g. REGEXP_LIKE(source,'[' ||unistr('\0020')|| ']');

Handler error while running ASP.Net web application

If you are getting invalid handler error while running IIS application on local IIS, chances are that you have installed IIS after you installed .Net framework/Visual Studio. The problem is basically IIS by default is not configured to handle ASP.Net files. When you install the Framework, it configures IIS to handle all files for ASP.Net i.e files with extension .aspx, .asmx, .ascx etc. So to fix the error, login as local administrator on your machine. Go to Visual Studio command prompt from Program files. On the command prompt execute following command aspnet_regiis -i Wait for successful installation. Now try again running your application under IIS. This should solve the problem. More information about aspnet_regiis can be found at http://msdn.microsoft.com/en-us/library/k6h9cz8h%28v=VS.100%29.aspx

What is the difference between ASP.Net Development server and IIS?

When you are developing web application using .Net, you have three options for development web server. 1. Visual Studio (2008/2010/2011) has built in development server 2. You can install local IIS (XP Professional/Windows 7 Professional/Ultimate) 3. You have a dedicated development Windows server. You can use any of above three options if there are only few developers in your organisation. However in an enterprise level development, you may want to coordinate code deployment to common development server to avoid overwriting each other’s code. So that leaves with first two options. Option 1 is good if there are restrictions in your organisation on what are allowed to install and you are developing and testing pages at page level. However there are some drawbacks of using ASP.Net development server you must consider. 1. Security Context: By default ASP.Net development server runs in local users security context which has more privileges than a context in which a IIS server o...

When to implement IDisposable?

In .Net, garbage collector is very good at cleaning up managed resources. Managed resources are object implemented using .Net framework and something that the Garbage collector is aware of. Unmanaged resource is anything that is implemented outside .Net framework and Garbage collector has no information about it. The combination of Destructor and Dispose can be used to release unmanaged resources for e.g open files or database connection. If you are not using any unmanaged resource, there is no need to implement IDisposable. Garbage collector will take care of release the unused objects and freeing up the memory.

What is Default search order for views in MVC 3?

By Default IIS will search for a view based on the Action method name in following orde ~/Views/ / .aspx ~/Views/ / .ascx ~/Views/Shared/ .aspx ~/Views/Shared/ .ascx ~/Views/ / .cshtml ~/Views/ / . cshtml ~/Views/Shared/ . cshtml ~/Views/Shared/ . Cshtml Note: It searches for a view than a partial view. Also it searches for a aspx page(ASPX rendering engine) first than a cshtml page(Razor engine)