2009-09-21 8 views
2

J'ai toutes mes vues dans un projet héritant d'une classe ViewBase qui hérite de UserControl. Dans mon XAML je le référence ainsi:Silverlight ViewBase dans un assemblage séparé - possible?

<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" 

Cela fonctionne très bien.

Maintenant, j'ai déplacé le ViewBase à un autre projet (donc je peux refernce à partir de plusieurs projets) donc je référencer comme:

<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" 

Cela fonctionne bien quand je lance à partir de l'IDE mais quand je lance le même sln MSBuild il donne un avertissement:

"H: \ dev \ ExternalCopy \ code \ UI \ Modules \ Configurer \ Forte.UI.Modules.Configure.csproj" (objectif par défaut) (10h12) -> (Valider la cible Xaml) -> H: \ dev \ ExternalCopy \ Code \ UI \ M odules \ Configure \ Views \ AddNewEmployee \ AddNewEmployeeView.xaml (1,2,1,2): warning: La balise 'ViewBase' n'existe pas dans l'espace de noms XML 'clr-namespace: Forte.UI.Modules.Common.Views; assembly = Forte.UI.Modules.Common '.

échoue avec:

"H: \ dev \ ExternalCopy \ code \ UI \ Modules \ Configurer \ Forte.UI.Modules.Configure.csproj" (objectif par défaut) (10: 12) -> (Valider la cible Xaml) -> C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): erreur MSB4018: la tâche «ValidateXaml» Échec inattendu. C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er pour MSB4018: System.NullReferenceEx ception: Référence d'objet non définie sur une instance d'un objet. C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er pour MSB4018: à MS.MarkupCompiler.ValidationPass.ValidateXaml (String fileName, Assembly [] assemb mensonges, Assembly callingAssembly, journal TaskLoggingHelper, boolean shouldThrow) \: .Common.targets (210,9): er pour MSB4018: à Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute() C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er pour MSB4018: à Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute() C: \ Program Files \ MSBuild \ M icrosoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er pour MSB4018: à Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute() C: \ Program Files \ MSBuild \ Microsoft \ Silverlight \ v3.0 \ Microsoft.Silverlight.Common.targets (210,9): er pour MSB4018: à Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask (moteur EngineProxy eProxy, seau ItemBucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean & taskResult)

Aucune idée de ce qui pourrait causer ce problème?

En utilisant Silverlight 3

Voici une version réduite du fichier MSBuild qui ne parvient pas à construire la SLN qui se construit bien dans l'IDE (désolé n'a pas pu l'obtenir pour formater ici):

< ? xml version = "1.0" encoding = "utf-8"? > < xmlns = "projet" http://schemas.microsoft.com/developer/msbuild/2003 DefaultTargets = "Compile" > <ItemGroup> < ProjectToBuild Inclure = ".. \ UI \ Forte.UI.sln" > < Propriétés > Configuration = Debug </Propriétés > </ProjectToBuild > </ItemGroup > < Nom target = "compilation" > < MSBuild Projets = "@ (ProjectToBuild)" > </MSBuild > </Target > </Projet >

Merci pour toute aide!

Répondre

0

La seule façon, pour l'instant, de contourner ce problème est de reférer l'assemblage actuel plutôt que le projet. C'est un peu hokey, quelqu'un a eu une meilleure idée?

Questions connexes