November 2005 - Posts - Raj Kaimal

November 2005 - Posts

VS.net 2005 Output window settings

By default, in VS.net 2005 RTM, the Output window (Ctrl + W, O) is docked at the bottom. After I build my project, I have to scroll to see the contents of this window which is annoying.

So, I made my Output window a Tabbed Document by right clicking on the header of the Output Window. This way it has more area to display the information.

Finally, to make sure the Output window is visible when building, I go to

Tools > Options > Projects and Solutions > General and make sure "Show Output window when build starts" is checked.

To quickly close the active document, I have defined Ctrl + ` as the keyboard shortcut for File.Close.

 

Posted by rajbk | 1 comment(s)
Filed under:

SiteMap nodes and identical urls

The XMLSiteMapProvider will throw an exception if you have multiple SiteMapNodes with the same URL in your Web.sitemap file. For example, the following

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode>
    <siteMapNode url=
"~/Employee/Home.aspx" title="Employee Home">
      <siteMapNode url="~/Common/Records.aspx" title="Records"/>
      <siteMapNode url="~/Employee/Profile.aspx" title="Profile" />
    </siteMapNode>
    <siteMapNode url=
"~/Admin/Home.aspx" title="Admin Home">
      <siteMapNode url="~/Common/Records.aspx" title="Records"/>
      <siteMapNode url="~/Admin/Profile.aspx" title="Profile" />
    </siteMapNode>
  </siteMapNode
>
</siteMap>

will fail with the following error

Multiple nodes with the same URL '/Navigation/Common/Records.aspx' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.

The simple workaround I came up with is to move all the contents of Records.aspx to a UserControl and have two aspx pages with unique names load this UserControl. So my sitemap file becomes:


      <siteMapNode url="~/Common/EmployeeRecords.aspx" title="Records"/>

      <siteMapNode url="~/Common/AdminRecords.aspx" title="Records"/>


ScottGu suggests that another (maybe easier) way to-do it is to have one of the .aspx files have a querystring attribute to it in the sitemap (for example: Records.aspx?param=1). The site navigation system allows you to differentiate using querystrings and will allow this.

A different approach as suggested by Danny Chen is that if you wanted to, since there is no requirement on the actual SiteMapProvider, you could write your own custom provider or possibly inherit from the XmlSiteMapProvider and override key functions (like AddNode, FindSiteMapNode) to get the behavior you're looking for.

Posted by rajbk | 2 comment(s)
Filed under:

Generating schema from XML file

Version: VS.net 2005 RTM

VS.net 2003 allowed you to generate an XML schema by opening an XML file, right clicking and selecting "Create Schema". This item has beem moved to the XML menu item on the top menu bar in VS 2005.

You can also go into your command window and type in:

XML.CreateSchema

Posted by rajbk | 1 comment(s)
Filed under:

VS.net 2005 RTM - Lost ability to create new websites

I am repairing VS.net 2005 as I type this. I am no longer able to create websites with VS.net 2005 RTM
:-(

Screen Capture (Flickr)


Failed attempts at fixing the problem:
  • devenv /ResetSettings in normal mode
  • Restarted Windows XP SP2 in safe mode and ran devenv
  • Changed MSCONFIG to Diagnostic startup and ran devenv
  • Verified that the template files were not missing
  • Reset my VS profile
  • devenv /installvstemplates

    Update

    I got the following helpful tips from the ASP.net team

  1. Open an existing web site (any folder will do) and try to add a new item. Is that dialog propulated? If it is, the registry settings should be correct.
  2. Check to see if the templates are installed. Look in c:\program files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\Web. Are there .zip files installed below this folder?
  3. Since expanding the zips is expensive, visual studio only does this once and caches the results in a parallel folder structure c:\program files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplatesCache. Is there a Web subfolder containing files? Note that there are actually a number of subfolders under the Web folder.
  4. Next check the application event log. Visual Studio logs errors if it fails to unzip templates or the templates are invalide. Are there entries in the event log?

In my case, the first three questions were all "Yes". I then looked in the event log and saw multiple occurrences of the following two entries:

  • One or more Visual Studio templates do not match any installed project packages.
  • .NET Runtime Optimization Service (clr_optimization_v2.0.50727_32) - Failed to compile: Microsoft.ReportingServices.QueryDesigners, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 . Error code = 0x80070002

So, I uninstalled SQL 2005, repaired VS.NET RTM and reinstalled SQL 2005 which fixed the problem.

Posted by rajbk | 1 comment(s)
Filed under:

ASP.net chat - Open request to the ASP.net team

I would like to request the ASP.net team to consider holding chat sessions from time to time. Just like before, each session should focus on a specifc area.

Looking at the
chat archive, the last time a chat with the ASP.net team occured was in December 2002.

Thanking you.

Posted by rajbk | 1 comment(s)
Filed under:
More Posts