首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >silverlight MatchTimeoutInMilliseconds bug :解决DomainServiceClientCodeGenerator

silverlight MatchTimeoutInMilliseconds bug :解决DomainServiceClientCodeGenerator
EN

Stack Overflow用户
提问于 2016-01-07 18:36:48
回答 2查看 2.6K关注 0票数 5

Silverlight 5 .Net框架4

我正在尝试为RIA代码生成器中的最近的错误实现一个解决方案,“MatchTimeoutInMilliseconds无法找到” https://connect.microsoft.com/VisualStudio/feedback/details/1988437/generated-code-for-silverlight-references-matchtimeoutinmilliseconds-which-does-not-exist

我正在尝试使用Lazebnyy的解决方案,但我似乎无法解决这个问题。

Lazebnyy写道:

从Nuget在RIAServices.T4或包含代码生成类的类库中安装WebProejct。PM>安装-软件包RIAServices.T4 创建两个类 DomainServiceClientCodeGenerator(typeof(MyServicesEntityGenerator),"C#")公共类MyServicesClientCodeGenerator : CSharpClientCodeGenerator {受保护的重写EntityGenerator EntityGenerator { get {返回新的MyServicesEntityGenerator();}公共类MyServicesEntityGenerator : CSharpEntityGenerator {受保护的覆盖无效GenerateAttributes(IEnumerableattributes,bool forcePropagation) { List newAttributes =新列表(属性);List regularExpressionAttributes =(从c.GetType() ==类型(RegularExpressionAttribute)选择c的属性中选择c)==();NewAttributes.RemoveAll(委托(属性)){返回attr.GetType() ==类型(RegularExpressionAttribute);};base.GenerateAttributes(newAttributes,forcePropagation);{ base.Write(string.Format("System.ComponentModel.DataAnnotations.RegularExpressionAttribute(@\"{0}\",ErrorMessage=@\“{1}”)\r\n“,item.Pattern,item.ErrorMessage));}} 现在,在Silverlight项目文件中,我们需要告诉RIA使用我们的生成器。我们必须编辑Silverlight项目,并在第一个PropertyGroup中添加以下元素,就在LinkedServerProject之后(顺序并不重要,我只是作为参考)。 ..\RIAServicesLibrary.Web\RIAServicesLibrary.Web.csproj RIAServicesLibrary.Web.Helpers.MyServicesEntityGenerator

无论我如何努力,我似乎无法解决DomainServiceClientCodeGenerator

代码语言:javascript
复制
[DomainServiceClientCodeGenerator(typeof(MyServicesEntityGenerator),"C#")]
  1. 我得到了Nuget软件包RIAServices.T4版本4.2.0,
  2. 将服务器端服务项目中的引用添加到Microsoft.ServiceModel.DomainServices.Tools.dll Microsoft.ServiceModel.DomainServices.Tools.TextTemplate.dll
  3. 我在代码中包含了名称空间 使用Microsoft.ServiceModel.DomainServices.Tools.TextTemplate.CSharpGenerators;使用Microsoft.ServiceModel.DomainServices.Tools.TextTemplate;

深入研究命名空间,我只能找到DomainServiceClientCodeGeneratorAttributeIDomainServiceClientCodeGenerator

有人能告诉我如何解决我丢失的DomainServiceClientCodeGenerator吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-01-07 20:00:55

我终于让它起作用了。该项目需要参考System.ComponentModel.Composition

这一关键信息来自http://jeffhandley.com/archive/2010/10/28/RiaServicesT4WalkUp.aspx

您会注意到,我需要添加一个对Microsoft.ServiceModel.DomainServices.Tools的引用,这样才能正常工作。该程序集位于我们的框架(而不是工具包)中,它是定义DomainServiceClientCodeGeneratorAttribute类的地方。此外,为了编译该属性,我需要添加对System.ComponentModel.Composition (MEF)的引用,因为该属性类实际上是从ExportAttribute派生的。

..。

(对于任何想知道的人来说,这并没有解决我的MatchTimeoutInMilliseconds错误)

票数 1
EN

Stack Overflow用户

发布于 2016-04-08 10:57:57

我花了大约4个小时来完成Silverlight 5+ Ria Services SP1项目,该项目是在Visual Studio 2012 + Windiws 7+ .NET Framework4中在Visual Studio 2015 + Windows 10中创建的,目的是修复此错误。

最初,我根本无法让它在Visual 2015中工作。

因此,我安装了Visual 2013 (完整类型安装)+ Service 5,获得的错误较少。

在此之后,我安装了所有旧的Silverlight东西,比如WPF工具包,然后我打开了解决方案,唯一的错误是

silverlight MatchTimeoutInMilliseconds bug :解决DomainServiceClientCodeGenerator

因此,在不对项目属性进行额外更改的情况下,我安装了.Net Framework4.6.2预览

这个错误就消失了!

我很好地编译了这个解决方案,之后我能够在Visual 2015.下编译它。

我希望我所花的时间能对某人有所帮助。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34662674

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档