June 2009 Entries
Recently I surfaced this error while trying to add reference of a WCF Service in Visual Studio 2008 running on Windows 7. Even when the WCF Service was browsed normally, it didn’t expose the Service Description Page that usually shows an implementation sample. I tried removing all code in the service, tried commenting, nothing worked. The ‘Root element is missing’ didn’t give much details on what could be the issue.
Every time this error throws up, The “Add Service Reference” operation could not be completed because the options get greyed out. This was frustrating. After a bit of research, I found out that the WCF ServiceModel had to be registered and since I had recently upgraded to Windows 7, I hadn’t done this. The solution for the same is to run the ServiceModelReg utility.
- To do that, if you are on Windows Vista or Windows 7, type “cmd” in run command.
- It lists you the Command Prompt Icon
- Right click on the icon and select “Run as Administrator”
- Select “Yes” to continue and the command window shows up
- In the command prompt, navigate back to C:\ by typing cd\
- Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation
- Type ServiceModelReg –i and press the enter key.
- It would do a series of installations and changes.
Thereafter you should be able to add reference to your WCF Services and also, when you browse the Service you can see the sample implementation screen as well.
For reading more about ServiceModelReg and the different switches that can be used, visit http://msdn.microsoft.com/en-us/library/ms732012.aspx
Please note, this was for WCF and if you surface the above error for WebServices, this solution may/may not work.
Recently, I upgraded to Windows 7 RC and found that the experience has been great. Zero compatibility issues, all works as it worked in Vista and the integration with Windows Easy Transfer (WES) has been phenomenal. If you don’t know WES, it is a tool available by default with Vista and Windows 7 that allows you to migrate your Outlook, IE, Desktop and other personal settings easily, in addition to backing up your files across different locations.
Coming back to the original intent of the post, as always I have the Beta versions and Visual Studio 2010 is something I can’t resist trying out on Windows 7 RC. Surprisingly, there was zero issues when installing on Windows 7 RC. The only work around that is running all over the internet is that SQL Server 2008 SP1 must have been installed before installing Visual Studio 2010 Beta on a Windows 7 RC machine.
I had it already so faced zero issues. If you don’t have SQL Server 2008 SP1 installed, you would want to do that first from here before installing Visual Studio 2010 Beta 1 on a Windows 7 RC machine.
Go ahead, install Windows 7, install SQL Server 2008 SP1 and Visual Studio 2010 and get to experience the latest with Application Development.
One of the cool things about ASP.NET 4.0 is the Query Extender and the ability to search within DataContext without using WHERE clause, writing extensive code etc., It works on the new set of namespace i.e. “System.Web.UI.WebControls.Expressions” namespace.
I am trying to put up an extensive sample using QueryExtender in the next post, but for this post, I wanted to share an error that you might hit when trying to implement the Query Extender control with Search Expression, Range Expression etc., This error is specific to the Visual Studio 2010 Beta 1 build that was released to public.
If you look at the MSDN sample for Query Extender it ports a markup like below for Query Extender
<asp:QueryExtender runat="server" TargetControlID="LinqDataSource1">
<asp:SearchExpression SearchType="StartsWith" DataFields="Name" >
<asp:ControlParameter ControlID="SearchTextBox" />
As you can see, the QueryExtender is useful only when you add SearchExpression etc., since they define the action that QueryExtender performs. However, when you try the above sample with Visual Studio 2010 Beta 1, you might get a build error and/or a runtime error that Unknown server tag ‘asp:SearchExpression’. The same error occurs for RangeExpression, PropertyExpression etc.,
You won’t even get intellisense for the above inside the QueryExtender tag.
The reason for the same is a simple mismatch in the web.config namespace reference entry. Once you add the following entry in the web.config file, this error would be gone.
<add tagPrefix="asp" namespace="System.Web.UI.WebControls.Expressions" assembly="System.Web.Extensions, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Note: The PublicKeyToken needs to be updated as per the other entries in this section, if different.
The above tag needs to be placed between <pages><controls>..</controls></pages> tags in the web.config file. Post this, you would also be able to get intellisense for these within the QueryExtender
As a part of my various experimentations, I do run Mozilla FireFox, Safari as well as Google Chrome. Recently, Mozilla had a crash and it doesn’t allow me to proceed further upon restarting it. The above screen shows up. I thought, clicking on “Restart Firefox” after submitting the information would help, but everytime I try running FireFox, the same dialog comes up.
There must be some indication that Mozilla wouldn’t function and I would need to reinstall or something like that.
Compared to the IE8’s crash recovery which not only restores the tab/browser and says that this has been recovered, the experience Mozilla Firefox gave is annoying.