by Naveen
8. June 2010 04:38
When you install Visual Studio 2010 you may notice that when you start writing some code in any language, intellisense may not be working as you expect from previous version of Visual Studio. What this could mean is that when you type few characters you are not being given hints and choices to auto-complete variable names or types etc. This is not a bug or anything. There is an option in Visual Studio settings that controls this behavior. For some reason, it is OFF by default. You will have to turn it on. Here are the steps that you will need to follow.
- Click on Tools > Options menu item.
- Click on Text Editors > All Languages link in left pane.
- In the right pane you will notice Statement Completion options at top. Make sure that you have
those checked to enable them.
If you have already have Visual Studio 2008 or earlier installed and had this statement completion enabled, then at the time of first time launch of Visual Studio 2010, when it asks you for import of settings from previous versions of Visual Studio, then you say yes to it and then you will not see statement completion disabled.
by Viper
8. October 2009 05:55
I was working on a silverlight form in an application. I was trying to add some validations and other related controls on the page. So I had added Label control on the page. I declared the xml namespace and associated tags at the top of the control file as well. When I tried to compile the application, I got the following error. I looked at the declarations, my SDK folder to make sure that I have the required SDK assemblies, I looked in GAC etc. Everything looked good and I still could not figure out what the problem is.
The tag 'Label' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly= System.Windows.Controls.Data.Input'
Could not load type 'Microsoft.Windows.Design.DataContextValueSourceAttribute' from assembly 'Microsoft.Windows.Design.Interaction, Version=3.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
What is the problem?
After spending good bit of time, I decided to look at one of the sample in SDK. I still could not figure out the issue. Then I decided to copy and paste the xml namespace and tags from the sample to my XAML file. Now everything worked fine. When I closely looked at the declaration, I saw the issue. See below, the one in red is wrong and one in green is good.
xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly= System.Windows.Controls.Data.Input"
xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
You can see I had an extra white space after assembly=. It seems that compiler is literally parsing the string and trying to look for assembly file with name as is in the statement. Instead of giving error message that some namespace or control does not exist in the assembly, the correct error message should have been that assembly with name or path could not be found. I could not complain much either because I am using Visual Studio 2010 Beta and beta version has lot of room for improvement.
by Viper
1. October 2009 13:59
Recently I installed Visual Studio 2010 and was working on a prototype User Activity Monitoring administration application. When I tried to launch the application in Visual Studio IDE, I got the following error message box.
---------------------------
Microsoft Visual Studio
---------------------------
Unable to start debugging on the web server. Debugging failed because integrated
Windows authentication is not enabled. Please see Help for assistance.
---------------------------
OK Help
---------------------------
As the error suggests that I need to enable windows authentication. And that is a pre-requisites for running ASP.Net application under debugger. But thing that was different is that till Visual Studio 2008 when you made the IDE to create Virtual Directory, it used to enable windows authentication in IIS for that virtual directory. It seems that Visual Studio 2010 does things differently. It only enables anonymous access. You will have to explicitly enable windows authentication. It is simple procedure.
- Launch IIS manager
- Right click on virtual directory and select Properties menu option
- Select Directory Security tab on the dialog box.
- On this view click on Edit button in Anonymous access and authentication control section at top
- On this dialog box, check the check box at the bottom in front of Integrated Windows Authentication option.
- Click OK and apply your changes.

by Viper
25. September 2009 12:14
First let me tell that I am new to TFS. I got tasked with installing and configuring TFS2008 for our development team. Everything was going smooth till the point when I tried to connect to TFS server from Team Explorer and get the following error thrown at me.
Microsoft Visual Studio
TF31002: Unable to connect to this Team Foundation Server: mytfsserver.
Team Foundation Server Url: http://mytfsserver:8080.
Possible reasons for failure include:
- The Team Foundation Server name, port number or protocol is incorrect.
- The Team Foundation Server is offline.
- Password is expired or incorrect.
For further information, contact the Team Foundation Server administrator.
When I looked at the error, it looked more like some kind of network error. But then I tried to access some other web services on the same error and nothing looked wrong. Well that was not very helpful. So far I was trying with Internet Explorer and I know that Team Explorer pretty much uses IE control behind the scene to connect to any kind of web services. So I fired up Fire Fox. It prompted me for my windows credentials. And now I got different kind of error but told me to look at the event logs. When I opened event log there were lot of errors from TFS and the last one looked like below:
Team Foundation Server
TF31001: Team Foundation cannot retrieve the list of team projects from Team Foundation
Server mytfsserver. The Team Foundation Server returned the following error:
Team Foundation services are not available from the server.
Technical information (for administrator):
TF53011: domain\username is not a licensed user..
So I opened up Team Explorer on TFS server itself and added my domain account into licensed users group and everything worked fine after that.
by Viper
23. September 2009 05:09
While working on an ASP.Net application on Visual Studio 2008, I ran into a problem. When I right clicked on the project to add a new page into the project, i got the error message that no templates could be found. Well, that was kind of strange that I was working on the project night before and I did not run into such problems. Recently Microsoft has become pretty good about their error reporting providing some initial hints. In this case the message said that I should look in the event logs to find more details. The event logs had the following error message.
The global template information is out of date. Regenerate the templates by running 'devenv.exe /installvstemplates' or reinstalling the application. Note: corrective action requires Administrator privileges.
In the past I would have took the option of reinstalling Visual Studio. But this time the error message provided an alternative to fix the issue by reinstalling templates by running a command line option. And it worked. After I ran the command, Visual Studio 2008 was back to its normal templates.
by Viper
1. July 2009 04:31
Recently my laptop has been behaving nicely to me. Because of an error in video card device driver, it kept crashing on me in middle of important development work or things like that. In times like that Visual Studio Auto Recovery has been god send for me. A lot of times I will have project or source code files not saved and system will Blue Screen (BSOD) on me. So I decided to dig around and see how I can tweak settings of auto recovery so I can make it to auto save more often than what it is doing now. You can do it from Tools > Options >AutoRecover view. See the screen shot below.
The options are very self explanatory. If you are interested in knowing where the autorecovery data is stored, you can find it at following location in your profile in windows.
C:\Documents and Settings\{username}\Application Data\Microsoft\VisualStudio\{vs version}\AutoRecoverDat
by Viper
19. May 2009 11:14
This morning i downloaded Visual Studio 2010 Beta 1 and decided to give it a try. Download went smooth. Took about an hour to download team Suite. Extracted ISO file and installed it. The installation went very smooth as well. It had to restart my machine after finishing installation of .Net 4.0 Framework. And after that installation of Visual Studio took place. Over all installation experience was very good. It did not take any long and in between there were no errors or things like that.
Now came to fire up the IDE and see how it works. Lets just say that I am not very impressed.
- There is no offline help available. So only option you have is online help.
- This is a show stopper for me. The performance is just horrible. I did not create an project. I just moved my mouse from start page to top menu bar. The CPU usage spikes to 100% for no good reason. Well there may be some reason that Microsoft knows about. And its very consistent.
I am not sure if i want to keep this Beta 1 on my development if I can't even move my mouse.
by Viper
1. January 2009 10:34
This morning I was trying to set up a new web site to host some silverlight applications. I went through all the steps to set up the site and then fired up the demo page in FireFox 3.0.5. To my surprise page kept coming back empty all the time. When I looked at the source of the page, I could see all the markup and JavaScript that was required to run silverlight applications. I thought that I forgot something to do on web server to support silverlight applications. I went through my check list and saw i have done all the things. Then I fired up web site in Chrome. The application came up nicely and same thing in Internet Explorer. I looked at the plugin lists in FireFox and saw that Silverlight is installed. So much for cross-browser/cross-platform framework. From what I could see that behavior of silverlight applications is very flaky in Firefox. Oh well!
You can try the following demo application I created for another article on silverlight communication between plugins.
Silverlight Cross-plugin communication
by Viper
31. December 2008 09:03
Lets talk about how you can pass some start up parameters to your silverlight application. In this post I will talk about how you can
do it with ASP.Net Silverligh control. The control allows passing start up parameters through InitParamaters
property. You can specify the parameters as commans separated key-value pair string. So you can pass values as described below.
InitParameters="key1=value1,key2=value"
So a simple definition of asp:Silverlight may look like the snippet below. You can see that
it is specifying two initial parameters k1 and k2 with value. And if you put a break point in Application_Startup
event of your silverlight application, you can see two parameters as show in image.
<asp:Silverlight ID="Xaml1" runat="server"
Source="~/ClientBin/InitParamsMgr.xap"
MinimumVersion="2.0.31005.0" Width="100%" Height="100%"
InitParameters="k1=v1,k2=v2" />
This look all well and good. Problem comes when you have one or more values that have commas embedded in it. If you
pass those value as such, framework is going to treat occurance of comma as separator and going to present
you with parameters that are not parameters. Look at the code snippet below where value for k2 key has comma in it.
And look at the screen shot showing how the parameters look like in debugger in application.
<asp:Silverlight ID="Xaml1" runat="server"
Source="~/ClientBin/InitParamsMgr.xap"
MinimumVersion="2.0.31005.0" Width="100%" Height="100%"
InitParameters="k1=v1,k2=v2,vx" />
Clearly you can see that application thinks that there are 3 parameters. Somebody suggested how about
repalcing comma in the value with some special character. Then I was like, what if that special character
is part of value as well. I was looking for a solution that is generic and would not require any
custom parsing in silverlight application. So I came up with solution of replacing comma with URL encoded
value %2C. And then in application I can use Uri.UnescapeDataString to decode the value.
So now the mark up looks as follows and in snapshots you can see that application treats two values correctly.
<asp:Silverlight ID="Xaml1" runat="server"
Source="~/ClientBin/InitParamsMgr.xap"
MinimumVersion="2.0.31005.0" Width="100%" Height="100%"
InitParameters="k1=v1,k2=v2%2cvx" />
private void Application_Startup(object sender, StartupEventArgs e)
{
if (e.InitParams.Count != 0)
{
string k2val = e.InitParams["k2"];
k2val = Uri.UnescapeDataString(k2val);
}
this.RootVisual = new Page();
}
Here is the list of URL encodings for special characters.
- Space %20
- " %22
- # %23
- % %25
- & %26
- ( %28
- ) %29
- + %2B
- , %2C
- / %2F
- : %3A
- ; %3B
- < %3C
- = %3D
- > %3E
- ? %3F
- @ %40
- \ %5C
- | %7C
by Viper
28. December 2008 18:48
For the first time I was trying to debug my silverlight application projects on Windows vista. Every time I was trying to load test page of my web application, i kept getting Error 2104, telling me that download of silverlight application is failing. For a moment I thought it may be settings in my browser that are preventing download of this silverlight application. I could not find anything strict in my settings that will prevent the download. Then i stsrtaed digging around and found that silverlight application has new file extension type ".xap" and its a new mime type as well. So I added a new entry in MIME types in IIS and there you go. It worked like a charm. Just add the following entries and you will be all set.
File Extension: .xap
Mime Type: application/x-silverlight-app
by Viper
27. December 2008 08:08
I was working on a custom control for silverlight. I was using Visual Studio designer to layout some controls on the page. All of a sudden i started getting AG_E_UNKNOWN_ERROR in XAML pane. I could not find anything wrong with any mark up or any attributes. I tried to remove and add some of the controls on the page. I then noticed that it was following a pattern. I was getting this error when adding a TextBox control on the page. And it was very consistent. After thinking about it I recalled that I was getting error for controls where I had added x:Name attribute to the control. I recalled when I was using Beta version of Silverlight 2, I used to get some errors in XAML for no reason. Looks like that problem has not gone away in release version on silverlight.
The way I got rid of this AG_E_UNKNOWN_ERROR was by closing project in Visual Studio and then reopen. And it works :-)