views:

66

answers:

2

I have a WPF project and compilation by Visual Studio/MSBuild seems to do 2 passes, with the latter pass adding some temporary resource files, e.g.

csc <options> <files>
csc <options> <files> /resource:obj\Debug\Project.g.resources

I suspect you cannot work around this (at least not without giving up code generation or XAML). But the problem I face with that is that every compiler warning is doubled. Even worse, they are in different languages! For example for me in English and German, with the first pass generating English warnings, and the second German warnings:

 5  The event 'SomeEvent' is never used           Foo.xaml.cs  29
 8  Unreachable code detected                     Bar.cs       33
34  Unerreichbarer Code wurde entdeckt.           Bar.cs       33
44  Das Ereignis "SomeEvent" wird nie verwendet.  Foo.xaml.cs  29

Obviously this generates a lot of noise.

Is this normal behavior or am I doing something wrong here? Are there any ways to improve this? It should show every warning only once, preferably in English. But everything in German would suffice, too.

A: 

Gix,

Double virtual machines ou maybe resources? don't know, try to use a /nowarn to remove it forcefully.

Waiting for sollution tho.

Kamia
A: 

When your XAML files reference types defined within the same project (ie xmlns:local="...") then the MSBuild process generates a temporary project to build the types so that the XAML compiler can properly generate the BAML and/or partial backing classes.

You can fix your double error messages by moving those types to a different assembly which will be compiled before your XAML project.

I'm stumped though as to why it uses different languages to report the errors for the two passes.

Paul Alexander