Welcome to MSDN Blogs Sign in | Join | Help

I had problems getting the Hyper-V Integration components installed in my VPC this evening. After a lot of kicking and stomping, I found a fellow MSFT-ie had the same issue and resolved it. Most of the issue is the fact that Hyper-V's integration components are called Integration Services (which is the same name as the SQL Server 2005++ components).

Anyways, Bob Duffy figured it out here:

http://blogs.msdn.com/boduff/archive/2008/12/18/problems-with-virtual-machine-bus-in-hyper-v.aspx 

This should have been obvious to me, and whoever you are searching for this, but apparently it's not possible to have a host OS that's bitlocker enabled and use the boot from VHD.

http://technet.microsoft.com/en-us/library/dd799282(WS.10).aspx

Bitlocker cannot be used to encrypt the host volume containing VHD files used for native VHD boot, and bitlocker cannot be used on volumes contained inside a VHD.

Just thought I'd share this with you, world.


If you're looking for insight into how you can create a quick VHD here's my process. First you'll need to download and install the following:

I've got a script that helps me create new bootable VHDs:

@Set SrcDrv=F:\
@Set sku=SERVERSTANDARD
@Set Wim2VhdPath=C:\VHDs
@Set vhdpath="c:\vhds\Win2008R2x64-fixed.vhd"
@Set disktype=Fixed
@Set size=/size:12000

@SetLocal
CSCRIPT %Wim2VhdPath%\WIM2VHD.WSF /WIM:%SrcDrv%\sources\install.wim /SKU:%sku% /VHD:%vhdpath% /disktype:%disktype% %size%

At this point, go to disk management (right-click Computer, click Manage) and attach the new VHD. Afterwords, you'll run the following script to create the boot entry using BCDBOOT. Open a command prompt as Administrator and run the following command:

bcdboot %drive%:\windows

Voila! You should be able to reboot and select your new bootable drive. If you want to change the boot settings, you'll need to do so using BCDEDIT

This is the first app that I get to work on for a customer that uses WPF and WCF. I'm finding the XML to be a bit cumbersome. Although the tools do help you get things right with WPF, I think the WCF tools are complicated.

I believe the next steps for these tools should be some updated tools for network monitoring, client and server certificate management, and some authentication test tools. It seems like every time I build a WCF app, I get stuck trying to figure out why the connection isn't authenticating properly...eh, probably lack of experience.

Anyways, What I've found in addition to it is an API for DirectShow for .NET. This API enables my .NET app to get video from the computer's camera and capture an image.

Ahh, after quite a few months on a tough project, It's great to write a technical blog again... 

You just want the error message to be displayed on the default SharePoint error page. Is this an easy

In Microsoft.SharePoint.Utilities.SPUtility there are 2 functions:

  • SPUtility.TransferToErrorPage - this transfers the user to the administrative layouts page for error messages
  • SPUtility.TransferToSuccessPage - this transfers the user to the page one would see after something such as a long running transaction

There are a few overloads for each and they come in handy when developing custom admin pages or custom lists.

This one is an awesome feature to add if you've got an application running a workflow asynchronously and on-the-fly (see post on programmatically launching a workflow) and you want to coordinate the results of said workflow synchronously, so.you have to wait for the workflow to complete.

image

Check out Microsoft.SharePoint.SPLongOperation. This object allows you to begin and complete the long operation quite easily.

SPLongOperation operation = new SPLongOperation(this) {
  LeadingHTML = "This is a bold description of my operation",
  TrailingHTML = "This is a normal sub-description of my operation"
};

operation.Begin();
Thread.Sleep(5000);
operation.End("/redirectpage.aspx");

Following the lead of Sara Ford, I think I want to do a 'How do I' piece for SharePoint developers. I don't know how long this will last, but this is the first post.

First off, layout pages require the following directives. Try as I may, I have never been able to get around whatever permission demand is blocking layout pages from inheriting a specific class.

<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page language="C#" MasterPageFile="~/_layouts/application.master" inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

The files must be placed in the %12-hive%\Template\Layouts directory-I usually create a custom folder underneath based on my specific feature to separate my custom code from SharePoint code. Incidentally, I recommend putting stylesheets, JavaScripts, and generic HTTP handlers here as well (the HttpHandler does allow you to create a code behind compile and deploy to this directory, which is cool). On your layouts pages you can add any web parts and custom controls you wish, you just have to add them manually as you don't have web part zones or personalization.

Note: By putting pages in the layouts directory, you may be breaching your security for the application as layouts pages are available to any authenticated user (not in a publishing scenario, though). Ensure that your pages are secured using controls such as the SPSecurityTrimmedControl.

In case you missed hearing about the new SDK, here's a great post on what's in it.

http://blogs.msdn.com/randalli/archive/2008/08/28/just-published-wss-and-moss-sdk-1-4-download-and-online-msdn-library-8-29-2008.aspx

I had enough trying to find this code, so I'm putting what I've pieced together to activate a workflow programmatically (specifically a SharePoint Designer Workflow)

public static string StartWorkflow(ContractListItem contract, string workflowName) {
            SPListItem wfListItem = contract.ListItem;
            SPWorkflowAssociationCollection wfAssocs = wfListItem.ParentList.WorkflowAssociations;
            SPWorkflowAssociation activeWorkflowAssoc = null;
            string errorMessage = string.Empty;

            foreach (SPWorkflowAssociation wfAssoc in wfAssocs) {
                if (wfAssoc.Name.Equals(workflowName)) {
                    activeWorkflowAssoc = wfAssoc;
                    break;
                }
            }

            // if the workflow exists, start the workflow
            SPWorkflow activeWorkflow = null;
            if (activeWorkflowAssoc != null) {
                try {
                    activeWorkflow = SPContext.Current.Site.WorkflowManager.StartWorkflow(
                        wfListItem,
                        activeWorkflowAssoc,
                        "<Data></Data>");
                }
                catch (Exception ex) {
                    ErrorHandler.LogError(Resources.ActionBarWebPart_WorkflowNotStarted, ex);

                    if (activeWorkflow != null)
                        SPWorkflowManager.CancelWorkflow(activeWorkflow);

                    errorMessage = Resources.ActionBarWebPart_WorkflowNotStarted;
                }
            }
            else {
                ErrorHandler.LogError(Resources.ActionBarWebPart_WorkflowDoesNotExist);
                errorMessage = Resources.ActionBarWebPart_WorkflowDoesNotExist;
            }
            return errorMessage;
        }
  }

I hate fishing around to get the publickeytoken for my strong named assemblies, so I fished around for a way to do it in Visual Studio. Here's what I did:

  1. Create a new External Tool - I called mine Get PublicKeyToken
  2. Map to the sn.exe file in the Windows SDK <DRIVE:\>Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sn.exe
  3. Add the command you want to execute, in this case, it's -T $(TargetPath) - you can get the TargetPath monniker from the flyout.
  4. Check the Use Output window checkbox.

Get PublicKeyToken

Now, to execute it, select a *.dll file. You can select the file in the bin directory of your dev project, go to Tools->Get PublicKeyToken and the output will be rendered to the Output window.

So, I scoured the internet (all of it, I swear) to find some information on readonly fields in SharePoint. Apparently, SharePoint workflows can write to readonly columns. The only problem I'm having now is getting the column to show up in a columns list.

private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e) {
  SPList list = workflowProperties.List;

  if (!list.Fields.ContainsField(FIELD_NAME))
    list.Fields.Add(FIELD_NAME, SPFieldType.User, false);

  SPFieldUser field = (SPFieldUser)list.Fields[FIELD_NAME];
  field.Title = FIELD_NAME;
  field.AllowDisplay = true;
  field.ReadOnlyField = true;
  field.ShowInDisplayForm = true;
  field.ShowInEditForm = true;
  field.ShowInDisplayForm = true;
  field.ShowInEditForm = true;
  field.ShowInListSettings = true;
  field.ShowInNewForm = true;
  field.ShowInVersionHistory = true;
  field.ShowInViewForms = true;
  field.Update();
}

private void codeActivity1_ExecuteCode(object sender, EventArgs e) {
  workflowProperties.Item["restricted"] = "test: " + DateTime.Now.ToShortTimeString();
  workflowProperties.Item.Update();
}

Woo- hoo! It works!

I just bought a video camera online, so I figured I'd check out the Live Cashback program and see if it would work out well. It totally rocked. I found the camera I wanted at a better price than I could find on other online shopping search sites, then I found I would get 4% back on the camera price and 4% back on the warranty to accompany it.

This deal totally rocks!

I just got my Navigon 7100 GPS and I have to say I'm impressed. I really like the navigation quality of the GPS, especially compared to my TomTom ONE. I like the TomTom's ease of use--in fact, I like it better than my friends Garmin nuvi, but the TomTom ONE doesn't have some really important features that I need for my weekly trek's about the east coast.

Anyway, the Navigon has icons that match the chain restaurants and hotels, Zagat ratings (including the reviews), a built-in traffic receiver, and more POIs than my TomTom.

So, here's the bad:

If you've never had a GPS before, the UI is a little cumbersome. It comes with a stylus because some of the icons/buttons are too small to hit with your finger--almost frustrating enough to send back.

In the end, I think I love it because of its actual navigation quality. It takes the same routes I would take (which neither Garmin nor TomTom would do). I also love the RealityView when you're on a major highway with a lot of lane decisions, it shows signs on a highway and an arrow for which lane you should be in. Finally, I love the fact that it allows me to extremely easily choose a POI or interim stop without making me rebuild my navigation course.

I presented a Silverlight 1.0/2.0 demonstration yesterday at CodeCamp and it went quite well. Most importantly, it compiled; hey, that's half the battle.

The talk started out about how POX is not truly a ReST service because POX services are not usually provided as post-able services that control and manage information processing. With POX services, the idea is really to share the information with the user interface. So, I put together a service that provided customer order information from the AdventureWorks catalog. The information was provided in JSON format to the front end Silverlight 1.0 and 2.0 interface.

The Silverlight 1.0 portion of the demo went really fast, mainly because I kept the JavaScript in code snippets so I wouldn't end up debugging any of it. The Silverlight 2.0 piece took some time because I had to write all the code from scratch because I forgot to save the code in snippets. It did look like I knew what I was doing, though.

Anyways, thanks to Mike Snell, Craig Oaks, and Dave Hoerster for hosting CodeCamp! It was a fun time and I got to eat burritos.

I ran into a problem when trying to use Peschka's PartCheck code for My Site autoconfiguration to modify some boolean fields on the Colleague Tracker web part and found some modifications you'll need to make in order to set boolean fields on controls with this code:

private object GetPropertySetterValue(string Value) {
  ...
  switch {
    ...
    default:
      bool result;
      if (bool.TryParse(Value, out result))
        return result;

      break;
  }
  ...
}

This will allow the boolean value to be passed correctly to the control.

I'm speaking at Pittsburgh's Code Camp on April 12th located at University of Pittsburgh's Sennott Square. I'll be presenting POX services using WCF and ReST (although many will agree that POX is not truly ReST) to supply data to a Silverlight 1.0 application and I will use the same services with a Silverlight 2.0 application.
More Posts Next page »
 
Page view tracker