Visual Studio 2010 problem with Vault

Working with Visual Studio 2010 and SQL 2008 I got this message out of the blue:
‘System.__ComObject’ to interface type ‘Microsoft.VisualStudio.OLE.Interop.IServiceProvider’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{6D5140C1-7436-11CE-8034-00AA006009FA}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Whoah… After a reboot, some thought, a few more attempts to build, and a bit of luck, I deduced with reasonable certainty that Vault, which I use for version control, was the culprit.
So I closed Studio 2010 and removed Vault. Then I opened the same solution and did a build with no problems. Next step is to figure out what to do about getting Vault back into play. Or not.

SharePoint 2010 Developer Dashboard

SharePoint 2010 can now provide additional performance and tracing information which is really really helpful if you are trying to debug and troubleshoot issues with page rendering time. It’s called the Developer Dashboard and is pretty easy to enable.

Using the object model:
SPWebService cs = SPWebService.ContentService;
cs.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.On;
cs.DeveloperDashboardSettings.Update();

Performance information into this Dashboard using the new SPMonitoredScope class

Using STSADM
There are 3 states: on, off or ondemand:
stsadm -o setproperty -pn developer-dashboard -pv ondemand
stsadm -o setproperty -pn developer-dashboard -pv on
stsadm -o setproperty -pn developer-dashboard -pv off

Off = Always off, normal state for production.

On = Always On, best for development only.

OnDemand = The user has the possibility to turn it on or off as needed using the small icon to the upper right hand corner of the page; you click the icon to toggle the dashboard on and off.

Note that this should be one of your first best practices for developing code for SharePoint 2010 – use SPMonitoredScope! This can only serve to help you better understand and manage the performance of your components as you deploy them.

More detail here: http://blogs.technet.com/speschka/archive/2009/10/28/using-the-developer-dashboard-in-sharepoint-2010.aspx

Microsoft WebsiteSpark program: free Web development tools

Microsoft just launched WebsiteSpark, a third program designed to foster development and design, in this case for the web, for three years with no up-front cost if you can meet their requirements. As I mentioned, this is the third “Spark” program out of Redmond. The first two are quite appealing in their own right and I have mentioned them before:

  1. BizSpark helps early-stage startups succeed, by providing Microsoft software, support, and visibility at no cost
  2. DreamSpark gives students professional-level developer and designer tools as well as training available at no charge.

There are, as always, catches. In this case their are two:

  1. The company interested in WebsiteSpark must have fewer than 10 employees and owners that build websites and Web applications on behalf of others.
  2. There is a $100 program offering fee, payable on exit.

If you can meet those two requirements, you’ll get access to the following:

  • Microsoft Web design and development tools, including three licenses of Microsoft Visual Studio 2008 Professional Edition, two licenses of Microsoft Expression Web 3, and one license of Microsoft Expression Studio 3
  • Four processor licenses for production usage to Windows Web Server 2008 or R2 (when available) and four processor licenses for production usage to Microsoft SQL Server 2008 Web Edition
  • A third-party premium Web site control panel (DotNetPanel)
  • Two technical support incidents per company
  • Access to community support through connections with Network Partners, Hosting Partners and peers with complementary services and technologies
  • Unlimited access to technical managed newsgroups on MSDN
  • Unlimited program support for nontechnical issues
  • Your company’s offerings featured in a WebsiteSpark marketplace (coming this fall), supported by Microsoft marketing vehicles

“Time out” for Session Timeouts

On occasion there is a need to persist a session for the duration that a page is in the browser without concern for security. Doing this with .NET / SharePoint is actually pretty easy.

Option A
You can hack your way to a solution, which works just fine, by doing the following.

  1. Add an iFrame / iFrame webpart and link to a custom page.
  2. In the code behind for the linked custom page put:

private void Page_Load(object sender, System.EventArgs e)
{
Response.AddHeader(“Refresh”, Convert.ToString((Session.Timeout*60)-10));
}

What will this do? Basically seconds before the session is due to expire it will post back to the server. Simples if naught crude? Perhaps. Effective. Definitely.

Option B
Or you could add something like this to your master page.

< asp:Timer ID=”tmCheckStatus” Interval=”1800000″ runat=”server”>

< /asp: Timer>

With a code behind resembling:

    Protected Sub tmCheckStatus_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmCheckStatus.Tick
If b2bGlobal.isUserOnline = False Then
'This is if you use forms authentication
'but I'd say it works equally fine for 'normal' sessions
'Or you can fire a popup or redirect to a page asking the users
'if they want to stay online
FormsAuthentication.SignOut()
FormsAuthentication.RedirectToLoginPage()
End If
End Sub

Option B example is from here. Needless to say tweaking is required…

Charting Data: Keeping it simple.

I see a lot on charting data in SharePoint, and out.

In my opinion it boils down to three things

  1. what have you got
  2. how did you get it
  3. how are you going to show it

The first two are data related and require some questions.

  • Is it flat data that can “just be charted”?
  • If not, what needs to be done?
  • Is it interactive?
  • If it is, in what way?
  • etc

The third can get complicated as it can delve into what one can only call, the aesthetics of the situation. Some people love pie charts with garish colours. Others simply cannot understand radar charts. One product that works very nicely, has lots of options, and has a nice cost at $0 under the GPL, is Visifire.

http://visifire.com/silverlight_charts_gallery.php

Visifire is a set of open source data visualization controls – powered by Microsoft® Silverlight™ & WPF. It is a multi-targeting control which can be used in both WPF & Silverlight applications. Using the same API, charts in both Silverlight & WPF environments can be created within minutes. Visifire can also be embedded in any webpage as a standalone Silverlight App. Visifire is independent of server side technology. It can be used with

  • ASP.Net
  • PHP
  • JSP
  • ColdFusion
  • Ruby on Rails
  • Simple HTML
  • Etc.
This control can be easily used to chart data in a list.

Let me show you how…

  • Upload the Visifire files to your SharePoint document library. Specifically, copy the VisiFire.xap and .js files into the document library that will hold your web part page.
  • Add a Data View web part for the list containing the data you wish to graph to the web part page using SharePoint Designer.
  • In the Code View, replace the line in the section with the following

Note:

  1. Columns in this example are @Budget and @Actual, update these if your list is different
  2. I have replaced “<" with "< " so that the code will get presented correctly in the browser

< type="text/javascript" src="Visifire.js" mce_src="Visifire.js">< /script>
< escaping="yes">< ![CDATA[ < type="text/javascript">
var xmlString =
‘ < vc="clr-namespace:Visifire.Charts;assembly=Visifire.Charts" theme="Theme2">‘
+ ‘ < text="Revenue">‘
+ ‘ < title="Month">‘
+ ‘ < title="$ Thousands">‘
+ ‘ < name="Budget" renderas="Column" axisytype="Primary">‘
]]>< /xsl:text>
< select="/dsQueryResponse/Rows/Row">
< escaping="yes">< ![CDATA[ + ' < axislabel="">< /xsl:text>
< select="./@Title">
< escaping="yes">< ![CDATA[" YValue="]]>< /xsl:text>
< select="@Budget">
< escaping="yes">< ![CDATA["/>‘]]>< /xsl:text>
< /xsl:for-each>
< escaping="yes">
< ![CDATA[ + ' < /vc:DataSeries>‘
+ ‘ < name="Actual" renderas="Line" color="Red" axisytype="Primary">‘
]]>< /xsl:text>
< select="/dsQueryResponse/Rows/Row">
< escaping="yes">< ![CDATA[ + ' < axislabel="">< /xsl:text>
< select="./@Title">
< escaping="yes">< ![CDATA[" YValue="]]>< /xsl:text>
< select="@Actual">
< escaping="yes">< ![CDATA["/>‘]]>< /xsl:text>
< /xsl:for-each>
< escaping="yes">
< ![CDATA[ + ' < /vc:DataSeries>‘
+ ‘ < /vc:Chart>‘;
< /script>
]]>< /xsl:text>
< !-- Create the div to hold the chart and then run -->
< !-- the JavaScript code to actually show the chart. -->
< id="myChart" style="width:500px;height:300px;">
< language="javascript" type="text/javascript">
var vChart2 = new Visifire(“Visifire.xap”);
vChart2.setDataXml(xmlString);
vChart2.render(“myChart”);
< /script> < /div>

Microsoft Windows Azure July 2009 CTP new features

This download extends Visual Studio to enable the creation, building, debugging, running and packaging of scalable Web applications and services on Windows Azure. A hot topic to say the least.

In case you are not sure what it is: “Windows Azure is the cloud operating system that serves as the development, run-time, and control environment for the Azure Services Platform.”

And you can get the whole marketing blurb here: http://www.microsoft.com/azure/default.mspx

If you are just getting started with the CTP go here Working with Multiple Web and Worker Roles and here Associating an ASP.NET Web Application (including MVC) as a Web Role.

Download it from here: Windows Azure Tools for Microsoft Visual Studio July 2009 CTP

Copy of text from the link page below
=====================================================

Overview


Windows Azure Tools for Microsoft Visual Studio extend Visual Studio 2008 and Visual Studio 2010 Beta 1 to enable the creation, building, debugging, running and packaging of scalable web applications and services on Windows Azure.

Please note that this is a CTP release and should not be used on production systems. Please see the EULA for more details.

New for the July 2009 CTP:

  • Support for developing and deploying services containing multiple web and worker roles. A service may contain zero or more web roles and zero or more worker roles with a minimum of one role of either type.
  • New project creation dialog that supports creating Cloud Services with multiple web and worker roles.
  • Ability to associate any ASP.NET Web Application project in a Cloud Service solution as a Web Role
  • Support for building Cloud Services from TFS Build
  • Enhanced robustness and stability

Windows Azure Tools for Microsoft Visual Studio includes:

  • C# and VB Project Templates for creating a Cloud Service solution
  • Tools to change the Service Role configuration
  • Integrated local development via the Development Fabric and Development Storage services
  • Debugging Cloud Service Roles running in the Development Fabric
  • Building and packaging of Cloud Service Packages
  • Browsing to the Azure Services Developer Portal
  • SSL Certificate selection

System Requirements

  • Supported Operating Systems: Windows 7; Windows Server 2008; Windows Vista

F#

I strongly believe that learning a new style of programming will make you a better programmer. F# has been on my radar for a while and I am contemplating a dive, shallow or deep I have yet to determine.

Yes, F# can possibly help a lot for certain classes of applications, but I do not know how much, if any at all, for line-of-business apps. My understanding is that F# is well suited for math and science applications and its functional nature can help write more reliable concurrent programs. Given the increasing number of multi-core processors, this might be prove valuable.