How to setup IIS to work with WCF By default WCF is not configured in IIS, the .svc handlers are usually missing so you won't be able to run or test your WCF project after publishing it. Adding .svc file mappings is the first step, and can be done easily by following the below steps: 1. On the server (where you want the .svc mappings to be set in IIS) go to this folder: %windir%\Microsof...
Problems with Indian MVP Community Website and Email List For those who are not aware of the Microsoft MVP award , here is a brief introduction: MVPs are independent experts who are offered a close connection with people at Microsoft. To acknowledge MVPs’ leadership and provide a platform to help support their efforts, Microsoft often gives MVPs early access to Microsoft products, as wel...
Most web applications use both Session state as well as the Cache . We all know that ASP.NET Cache is more of a global storage cauldron for in-memory objects, where as the Session object is limited to each user. Now in a recent project, we faced a tricky issue with our internal Session usage. We were storing user roles inside the session, and wanted to refresh the role list when the user...
For efficient SEO, it is better that each URL should render unique data. So that means URLs having duplicate content, like http://mysite.com, http://www.mysite.com and http://www.mysite.com/default.aspx should be redirected to only a single URL having the same content. Scott Mitchell has a really nice article on this topic . But there is a catch! AFAIK, the code below (from the article) ...
**UPDATE** We finally got some decent reply from the MediaSoftPro programmer, and he has promised us to resolve all our support issues. We are happy with the support now, and I hope they continue to give the same support to all of their other customers as well. Some companies try hard to market their software products but do not care about support at all. MediaSoftPro seems to be one of ...
Forms Authentication timeout vs session state timeout In ASP.NET web applications, when using Forms Authentication, we need to be aware of two different time outs when dealing with a logged in user relying on session data: 1. Forms Authentication ticket timeout 2. Session state time out When the user is trying to login, it is best to create a forms authentication ticket yourself after th...
How to install IIS on Windows 7 By default, Windows 7 Pro/Ultimate does not come with IIS 7 installed. Here is how you can add this extra feature: 1. Go to Start->Control Panel-> Programs and Features. 2. Select "Turn Windows features On or Off". 3. In the window that opens next, make sure to check IIS box, and click OK to install it. 4. After the installation, you can view your ho...
Recently while uploading a file to an online file management system (ASP.NET based), I got this weird error: Silverlight-Error-open-[IO.IO_SharingViolation_File] Debugging resource strings are unavailable . This sharing violation opening a file with OpenfileDialog error was coming whenever I was uploading a MS word document which was already opened for editing on my local system. Weird t...
With ASP.NET MVC 3 to be out soon, there are still many developers confused on whether to use MVC or the standard Web Forms UI while building their own custom ASP.NET web applications. I know this has been debated numerous times in the past but let me write on this topic in brief. It would be best to understand this excerpt from the man who created the ASP.NET platform , the great Scott ...
Here is some quick code to convert an integer to an enum in C#: Assume we have an enum UserInfoDisplayField Method 1: UserInfoDisplayField myEnum=(UserInfoDisplayFieldType)Enum.ToObject(typeof(UserInfoDisplayFieldType),1)); Method 2: UserInfoDisplayField myEnum=(UserInfoDisplayFieldType)1; You can also check the existence of the enum value before conversion using the Enum.IsDefined field...
Run ASP.NET 2.0 and 3.5 applications on the same server Yes, you can run both together, infact the 3.5 applications use the 2.0 compiler. Why? Because version 3.5 is just a wrapper around 2.0 with some additional assemblies. But the newer 4.0 version is a completely new version, and will not be compatible with older versions. That is you cannot compile 3.5 or 2.0 code using 4.0 compiler,...
How to call C# code within ASPX page Many times we might need to call the C# or VB.NET code from within the ASPX page instead of using a code-behind file. Here is a quick code snippet to do the same: <%@ Page Language= "C#" %> <script runat= "server" > void Page_Load(object sender, EventArgs e) { MyLabelControl.Text = "time is " + DateTime.Now.ToString(); } //now a button cli...
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Microsoft has been made aware of an issue with a McAfee DAT file update - released Wednesday, April 21, 2010 - that has been causing stability issues on Windows XP client systems. The symptom is caused by a false-positive detection on a core Windows file (svchost.exe). Once the file is quarantined by McAfee, the sy...
Microsoft has a wonderful tool which can easily be installed on your server and gives you detailed reports on SEO-bility of your website, specifically: 1. you can run multiple reports to find out if your site has any major SEO issues. 2. not only does the toolkit identifies SEO issues, but also helps you fix them too. 3. it will index all reachable links on your website and provide detai...
Suppose you are running your ASP.NET application on a domain like http://www.mydomain.com, and you want to access this domain (www.mydomain.com) in your code. The below method can be used to get the host name: string host= HttpContext.Current.Request.Url.Host; One problem with this is that it will not get port number. For detailed explanation and other possible solutions, refer this link...
In one of our products, Communifire, we were dealing with a rather "silly" issue related to persistence of cookies in IE 8. We had created a new easy to implement Single Sign On (SSO) feature which lets users share authentication across parent domain and sub-domain (assuming CF is running on a sub-domain whereas users login via the parent website hosted on the TLD). We were creating a ne...
While using Fiddler to examine HTTP traffic on your localhost, you may get this error: Fiddler: No connection could be made because the target machine actively refused it This happens because by default .NET bypasses local proxies while sending requests and Fiddler runs as a proxy. One way to catch local HTTP traffic is to change the URL in the browser by appending a "dot" to it (after t...
I noticed a developer encoding an already RSA encrypted byte array to a string format, so that he can save it in database. He was using this code: byte[] message = Encoding.UTF8.GetBytes("string to be encrypted"); byte[] encrypted = rsaAlgo.PrivateEncryption(message); string save_in_db = Encoding.UTF8.GetString(encrypted); Then he simply wanted to decrypt save_in_db to its original value...
Hastables are deprecated now because with .NET 2.0 and above the Dictionary class is introduced which is much more efficient because it does not need to box or unbox data while adding/retrieiving items. ListDictionary should be used when the number of items are small (usually less than 10). Else if you are sure that your list will have more items, than use Dictionary. If you are not sure...
Many beginner developers do not realize how effcient caching mechanisms can play a big role in increasing application performance. Most developers are accustomed to using the default In-Proc session state, or the Cache object to store the application related data. While such in-built caching mechanisms will work perfectly fine for most applications which do not need to scale to higher le...
Recently I got this error while installing SQL Server 2005 64 bit on a machine where previously SQL Server 2005 32 bit was installed: Failed to install and configure assemblies C:\Program Files\Microsoft SQL Server\90\DTS\Tasks\Microsoft.SqlServer.MSMQTask.dll in the COM+ catalog. Error: -xxxxx Error message: Unknown error xxxx Error description: One or more of the components being insta...
When should you use Abstract classes for implementing dynamic polymorphism? and when Interfaces are your best option? Most beginners tend to get confused between Abstract classes and Interfaces, so here is a quick primer: In Abstract classes you can use "abstract" keyword to mark methods which *must* to be implemented in derived classes, and use the "virtual" keyword to create some concr...
Today I was installing MS Visio Enterprise Architect and got this error the moment the installer started to load: "You must first install one of the qualified Visual Studio editions". Considering that I have already installed Visual Studio 2008 Architectecture Edition, this error was very frustrating...after searching Google I noticed this post which mentioend that the Visio installer lo...
The seriousness of the world economy is starting to worry me. Not that it has affected my business one bit. But with billionaire investor George Soros telling the Times of London, "The chances of a depression are quite high," I realize there are lots of IT professionals who are not adequately prepared. How can they be? They're IT professionals, not sales and marketing professionals. And ...
In your windows forms applicatons, if you want to hide/make inivisible a row of the DataGridView control at runtime, you would assume that this line will do the trick: for (int i = 0; i < dgridView.Rows.Count; i++) { if(someCondition) dgridView.Rows[i].Visible = false; } But the moment you do this, you will get this error: Row associated with the currency manager's position cannot be ...
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address:
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18