Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiling XAML file to BAML

157 views
Skip to first unread message

Jaakko Salmenius

unread,
Feb 10, 2009, 3:44:09 AM2/10/09
to
Hi

My goal is to manually compile satellite assembly files for each languages. I have localized XAML and resx files. For example if the
original file is Window1.xaml I have Window1.de.xaml, Window1.fr.xaml, etc. I use AL.exe to link the satellite assembly files using
the compiled resources (.resources) that contain binary .resx and .xaml data. This works very well but I have problems to compile
some XAML files.

I need to compile an XAML file (.xaml) to binary XAML (.baml) file. I am using a .proj (e.g. Sample.proj) file that contains a
single .xaml file. Then I call MsBuild.exe with two task (ResolveReferences and MarkupCompilePass1)

C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe /t:ResolveReferences;MarkupCompilePass1 Sample.proj

This succesfully compiles XAML file to BAML. However it can not compile XAML file that refers to a locally defined type. According
to MSDN you have to use MarkupCompilePass2 and GenerateTemporaryTargetAssembly. When I try these I get an error message:

"D:\Support\WPF\SimpleLocal\SlCompile1.proj" (ResolveReferences;MarkupCompilePa
ss1;GenerateTemporaryTargetAssembly;MarkupCompilePass2 target) (1) ->
"D:\Support\WPF\SimpleLocal\d4npoyom.tmp_proj" (_CompileTemporaryAssembly targe
t) (2) ->
(CoreCompile target) ->
CSC : error CS5001: Program 'd:\Support\WPF\SimpleLocal\obj\Debug\SimpleLocal
NamespaceReferenceLocalizationTest.exe' does not contain a static 'Main' method
suitable for an entry point

Is it possible to use MsBuild to compile XAML files refering to local types?

I have been trying another approach where I create a .csproj that creates .dll assembly. However there is no documentation about
what the .csproj for a satellite assembly file should contain. Visual Studio can not do such a project file and I have not managed
to do it manually.

Best regards,
Jaska

0 new messages