Archive

Posts Tagged ‘Visual Studio’

MSBuild fails to compile WPF with: error MC2000: Unkown build error ‘…’ does not have an implementation

June 14th, 2010 No comments

My initial solution in this post was WRONG, it just changed the compile order of our build which made the error occur later after other issues were resolved. I’ve updated the post accordingly. I’m sorry if anyone had to read this post twice.

We have been struggling with a build error lately, where the compilation works perfectly in Visual Studio, and in our case it also works in some MSBuild builds but not in this specific build. By that I mean that two builds are compiling the same code, with the same dependencies and compilation flags, yet one fails and the other doesn’t.

The error message given is:

D:\Invoicing\UQList.xaml(55,167): error MC2000: Unknown build error, 'Method 'add_PropertyChanged' in type 'UsageQuantityPresenter' from assembly 'ServiceManagementApplication' does not have an implementation. Line 55 Position 167.' 

If we look at the buildlog.txt produced by MSBuild in the failing build, we can find something similar to this:

  Input file 'D:\Invoicing\UQList.xaml' is resolved to new relative path 'Invoicing\UQList.xaml' at directory 'D:\'.
D:\Invoicing\UQList.xaml(55,167): error MC2000: Unknown build error, 'Method 'add_PropertyChanged' in type 'UsageQuantityPresenter' from assembly 'ServiceManagementApplication' does not have an implementation. Line 55 Position 167.'
  Input file 'D:\Trait\TraitsView.xaml' is resolved to new relative path 'Trait\TraitsView.xaml' at directory 'D:\'.
...
  Generated BAML file: 'D:\obj\Release\Themes\luna.normalcolor.baml'.
  Generated BAML file: 'D:\obj\Release\Trait\TraitsView.baml'.
  Markup compilation is done.
Done executing task "MarkupCompilePass2" -- FAILED.
Done building target "MarkupCompilePass2" in project "ServiceMangementApplication.csproj" -- FAILED.

In the XAML we are depending on the UsageQuantityPresenter to implement INotifyPropertyChanged, which it does. However it also implements other interfaces and does inheritance of a base-class.

This is what it looked for for us:

/// <summary>
/// UsageQuantityPresenter
/// </summary>
public class UsageQuantityPresenter : EntityViewPresenterBase, IUsageQuantity
{
...

The EntityViewPresenterBase (I hate that class name by the way) implements INotifyPropertyChanged.

The solution was found in the following forum tread: http://social.msdn.microsoft.com/Forums/en/wpf/thread/00907c94-c6b2-4bf1-98f9-113c5c4392d8

It states that you should add:

<AlwaysCompileMarkupFilesInSeparateDomain>true</AlwaysCompileMarkupFilesInSeparateDomain>

to the .csproj file with the XAML files. Doing this makes MSBuild happy again.

Changing the default browser in Visual Studio 2010

May 18th, 2010 1 comment

I found a quite funny behavior in Visual Studio 2010 when working with Silverlight applications. The problem is that if your running Silverlight applications in Firefox it doesn’t clear the cache when loading your test page. End result is that your running an old version of the Silverlight code every time you debug.

A possible workaround is to change the browser used while debugging to Internet Explorer.

This is how you do it:

  1. Start a new Web site project (It can’t be done in a Silverlight project)
  2. Right click a webpage
  3. Select “Browse With”
  4. In the displayed dialog, select Internet Explorer
  5. Press the set default button
  6. Now close the dialog
  7. Open the Silverlight project

 

    Now all debugging will open in Internet Explorer instead. Internet Explorer clears the cache when doing debugging, so you shouldn’t experience the problem.

Trying out the VS2010 RC1 F# Tutorial

February 15th, 2010 No comments

So I’ve started some experiments on VS2010 RC1. I plan to post more about them later (MVC.Net 2 things mostly). But I noticed when I was going through the different project types that there is a F# tutorial with VS2010.

I though Great! Really nice idea to have an easy accessible introduction to the programming environment and language available directly in the product.

However I was let back when I started it this weekend. It’s not a tutorial, its not even an introduction. It’s just a cheat sheet for the F# language syntax.

It’s not a bad cheat-sheet. I got mostly everything I needed from it. But I just wish they did more with this. Or just move the cheat sheet online, and reference it. This is just something in between.

Tags: ,

Saving space for test results in Visual Studio 2008

November 20th, 2008 No comments

I keep forgetting to make this setting when I configure a new development environment.

Visual studio Testresults setting

Visual studio Test results setting

The default setting for this is 25, meaning that visual studio will keep the 25 last test results for the specific test project. With many test-projects and especially if you work in several branches with testing the amount of storage the tests results require can be quite substantial. Especially if you run tests in win-forms applications that have a lot of graphics.