C# WF 4语言特定资源DLL出现错误

C# WF 4语言特定资源DLL出现错误,c#,workflow-foundation-4,C#,Workflow Foundation 4,我正在使用WF 4开发一个重新托管的工作流设计器,我使用此设计器控件的应用程序是一个多语言应用程序,可加载2个或更多特定于语言的资源DLL。如果一种语言(如“en”和“en-US”)有两个附属程序集,designer会抛出如下异常: Compiler error(s) encountered processing expression "testExpression". The project already has a reference to assembly MyProject.resou

我正在使用WF 4开发一个重新托管的工作流设计器,我使用此设计器控件的应用程序是一个多语言应用程序,可加载2个或更多特定于语言的资源DLL。如果一种语言(如“en”和“en-US”)有两个附属程序集,designer会抛出如下异常:

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)
值得一提的是,当我查看附属程序集的属性“详细信息”选项卡时,我意识到它们都是中性语言。我认为它们必须是特定的语言,以便应用程序能够识别出这些DLL是不同的


我能做些什么来克服这个问题,我能改变dll文件的语言属性,使之成为特定于语言的吗?这有帮助吗?

我也遇到了同样的问题,我可以通过定义设计器可以通过其AssemblyContextControlItem“查看”的DLL来修复它,过滤掉附属程序集(我根本不需要):

var acci=this.Designer.Context.Items.GetValue()??新建AssemblyContextControlItem();
acci.ReferencedAssemblyNames=acci.AllAssemblyNamesContext
.Select(an=>newsystem.Reflection.AssemblyName(an))
.Where(an=>!an.Name.Contains(“.resources”))
.ToList();
this.Designer.Context.Items.SetValue(acci);
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);