Silverlight ViewBase in a separate assembly - perhaps?

I have all my views in a project that inherits from the ViewBase class, which inherits from UserControl. In my XAML I am linking like this:

<f:ViewBase x:Class="Forte.UI.Modules.Configure.Views.AddNewEmployeeView"
    xmlns:f="clr-namespace:Forte.UI.Modules.Configure.Views"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 

      

It works great.

Now I have moved the ViewBase to a different project (so I can link to it from multiple projects), so I link to it like this:

<f:ViewBase x:Class="Forte.UI.Modules.Configure.Views.AddNewEmployeeView"
    xmlns:f="clr-namespace:Forte.UI.Modules.Common.Views;assembly=Forte.UI.Modules.Common"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 

      

This works great when I run from the IDE, but when I run the same sln from MSBuild it gives a warning:

"H: \ dev \ ExternalCopy \ Code \ UI \ Modules \ Configure \ Forte.UI.Modules.Configure.csproj" (default target) (10:12) → (ValidateXaml target) → H: \ dev \ ExternalCopy \ Code \ UI \ Modules \ Configure \ Views \ AddNewEmployee \ AddNewEmployeeView.xaml (1,2,1,2): warning: tag 'ViewBase' does not exist in XML namespace 'clr-namespace: Forte.UI.Modules.Common.Views ; assembly = Forte.UI.Modules.Common ".

Then it fails:

"H: \ dev \ ExternalCopy \ Code \ UI \ Modules \ Configure \ Forte.UI.Modules.Configure.csproj" (default target) (10:12) → (ValidateXaml target) → C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): Error MSB4018: The "ValidateXaml" task ended unexpectedly. \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: System.NullReferenceException: Object reference not set to object instance. \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in MS.MarkupCompiler.ValidationPass.ValidateXaml (String fileName, Assembly [] assembly false, AssemblyAssembly, TaskLoggingHelper log, Boolean shouldThrow) \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft .Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft .Silverlight.Common.targets (210,9): er ror MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask (EngineProxy engin eProxy, ItemBucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean & taskResult)Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Silverlight.Build .Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Silverlight. Build.Tasks.ValidateXaml.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Build.BuildEngine .TaskEngine.ExecuteInstantiatedTask (EngineProxy engin eProxy, ItemBucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean & taskResult)Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Silverlight.Build .Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Silverlight. Build.Tasks.ValidateXaml.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: in Microsoft.Build.BuildEngine .TaskEngine.ExecuteInstantiatedTask (EngineProxy engin eProxy, ItemBucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean & taskResult)at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018 : in Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask (EngineProxy engin eProxy, ItemBucket, TaskExecutionMode howToExecuteTask, ITask, Boolean & taskResult)at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018 : in Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute () \ r C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er ror MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask (EngineProxy engin eProxy, ItemBucket, TaskExecutionMode howToExecuteTask, ITask, Boolean & taskResult)Common.targets (210,9): er ror MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask (EngineProxy engin eProxy, ItemBucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean & taskResult)Common.targets (210,9): er ror MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask (EngineProxy engin eProxy, ItemBucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean & taskResult)

Any ideas that might be causing this behavior?

Using Silverlight 3

Here is a clipped version of the MSBuild file that can't build sln that builds fine in the IDE (sorry, couldn't format it):

<? xml version = "1.0" encoding = "utf-8"? > <Project xmlns = "http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets = "Compile"> <ItemGroup> <ProjectToBuild Include = ".. \ UI \ Forte.UI.sln"> <Property > Configuration = Debug </ Property> </ProjectToBuild> </ItemGroup> <Target Name = "Compile"> <MSBuild Projects = "@ (ProjectToBuild)"> </MSBuild> </Target> </ Project>

Thanks for any help!

+2


source to share


1 answer


The only way I've found to work around this is to pass the actual assembly, not the project. This is a bit of a hokey, who has an idea?



0


source







All Articles