2013-05-28 16 views
3

我正在使用WF 4的重新主辦的工作流設計器,我的應用程序使用此設計器控件是一種多語言應用程序,可加載2個或更多語言特定的資源dll。如果我有一個語言的兩個附屬組件,如「恩」和「EN-US」,設計師拋出這樣一個異常:WF 4語言特定的資源DLL錯誤

Compiler error(s) encountered processing expression "testExpression". The project already has a reference to assembly MyProject.resources. A second reference to 'C:\Dlls\en-US\MyProject.resources.dll' cannot be added. 

,這裏是堆棧跟蹤:

at Microsoft.VisualBasic.Activities.VisualBasicHelper.Compile[T](LocationReferenceEnvironment environment, Boolean isLocationReference) 
    at Microsoft.VisualBasic.Activities.VisualBasicHelper.Compile[T](LocationReferenceEnvironment environment) 

這是值得一提的是,當我看看我的衛星組件的屬性Details選項卡時,我意識到它們都是中性語言。我認爲他們必須是特定語言,因此應用程序可以認識到這些dll是不一樣的。

我能做些什麼來克服這個問題,我可以更改dll文件的語言屬性以成爲語言特定的?這可以幫助嗎?

回答

1

我有這個同樣的問題,我可以定義什麼DLL的設計者可以「看到」通過其AssemblyContextControlItem,過濾掉衛星組件(我沒有反正需要)修復:

var acci = this.Designer.Context.Items.GetValue<AssemblyContextControlItem>() ?? new AssemblyContextControlItem(); 
acci.ReferencedAssemblyNames = acci.AllAssemblyNamesInContext 
            .Select(an => new System.Reflection.AssemblyName(an)) 
            .Where(an => !an.Name.Contains(".resources")) 
            .ToList(); 
this.Designer.Context.Items.SetValue(acci);