Archive

Archive for the ‘Windows’ Category

Convert WCF Binding to a Custom Binding

June 8th, 2010 Comments off

A recent post on Aggregated Intelligence pointed out WCF Binding Box, an excellent tool that allows you to convert an out-of-the-box WCF binding to a custom binding configuration.

I had to give this another mention as this is a huge time saver if your use case doesn’t quite fit the default WCF binding scenarios and you don’t want to start from scratch with a custom binding

Categories: Software Development, Windows Tags: , , ,

TFS Build Error When Publishing Test Results to TFS

April 29th, 2010 Comments off

When running a build on a Team Foundation Build Server 2008 I was unable to get unit test results to be reported back to TFS.  The following entry was found in the build log (where <projectname> is the name of the TFS project):

Build “vstfs:///Build/Build/830″ cannot be found under team project “<projectname>”.

The problem is a result of a fix in TFS 2008 SP1. Before SP1, $(BuildNumber) was used to report test results back to TFS.  This was a problem since the build number was not always guaranteed to be unique.  In SP1 this was fixed by using $(BuildUri) instead.

This problem shows up if you are running TFS 2008 SP1 along with TFS Build 2008 (without SP1). The simple solution is to install TFS 2008 SP1 on the build server.

To complete the update just run the installer on the build server.  It will detect that TFS Build is installed and it will update it to SP1.

ClickOnce Installation Location

January 13th, 2010 3 comments

Every time I have to find the installation location for ClickOnce apps I end up having to consult the Google.

I am posting the installation directory here so I don’t have to go looking next time:

Windows XP:
C:\Documents and Settings\<username>\Local Settings\Apps

Windows Vista/Windows 7:
C:\Users\<username>\AppData\Local\Apps

Running WPF Apps in VirtualBox

January 13th, 2010 Comments off

I was recently using VirtualBox to test a networked WPF app that I am experimenting with and I got the ‘oh no, something went horribly wrong’ dialog:

Here are the details of the exception logged using log4net.

System.Runtime.InteropServices.COMException (0x88980406): Exception from HRESULT: 0x88980406
   at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
   at System.Windows.Media.MediaContext.CompleteRender()
   at System.Windows.Media.MediaContext.CreateChannels()
   at System.Windows.Media.MediaSystem.ConnectChannels(MediaContext mc)
   at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher)
   at System.Windows.Media.MediaContext.From(Dispatcher dispatcher)
   at System.Windows.Media.Visual.VerifyAPIReadWrite()
   at System.Windows.Media.VisualCollection.VerifyAPIReadWrite(Visual other)
   at System.Windows.Media.VisualCollection.Add(Visual visual)
   at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)
   at System.Windows.Controls.UIElementCollection.Add(UIElement element)
   at System.Windows.Controls.UIElementCollection.System.Collections.IList.Add(Object value)
   at System.Windows.Markup.BamlRecordReader.AddToContentProperty(Object container, Object contentProperty, Object value)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
   at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
   at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
   at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
   at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
   at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
   at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
   at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
   at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
   at System.Windows.Markup.TreeBuilder.Parse()
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
   at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
   at System.Windows.Application.DoStartup()
   at System.Windows.Application.<.ctor>b__0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

It turns out that this is a known defect in VirtualBox that occurs when using 3D acceleration.

The workaround is fairly simple: shut down the VM and disable 3D acceleration in the virtual machine display settings. The WPF app should now run correctly.

It appears that this bug affects multiple OS versions (XP, Vista) but I my case this was occurring on a Windows XP SP3 guest OS running on a Windows 7 64-bit host.