c# - silverlight MatchTimeoutInMilliseconds bug : resolve DomainServiceClientCodeGenerator -
silverlight 5 .net framework 4
i trying implement workaround recent bug in ria code generator "matchtimeoutinmilliseconds not found" https://connect.microsoft.com/visualstudio/feedback/details/1988437/generated-code-for-silverlight-references-matchtimeoutinmilliseconds-which-does-not-exist
i'm trying use workaround lazebnyy, can't seem domainserviceclientcodegenerator resolve.
lazebnyy writes:
install riaservices.t4 nuget in webproejct or class library contain the code generation classes. pm> install-package riaservices.t4
create 2 classes
[domainserviceclientcodegenerator(typeof(myservicesentitygenerator),"c#")] public class myservicesclientcodegenerator : csharpclientcodegenerator { protected override entitygenerator entitygenerator { { return new myservicesentitygenerator(); } } } public class myservicesentitygenerator : csharpentitygenerator { protected override void generateattributes(ienumerable<attribute>attributes, bool forcepropagation) { list<attribute> newattributes = new list<attribute>(attributes); list<attribute> regularexpressionattributes = (from c in attributes c.gettype() == typeof(regularexpressionattribute) select c).tolist(); newattributes.removeall(delegate(attribute attr) { return attr.gettype() == typeof(regularexpressionattribute); }); base.generateattributes(newattributes, forcepropagation); foreach (regularexpressionattribute item in regularexpressionattributes) { base.write(string.format("[system.componentmodel.dataannotations.regularexpressionattribute(@\"{0}\", errormessage=@\"{1}\")]\r\n", item.pattern, item.errormessage)); } } }
now hook up, in silverlight project file need tell ria use our generator. have edit silverlight project , add following element inside first propertygroup after linkedserverproject (the order doesn't matter, reference).
<linkedserverproject>..\riaserviceslibrary.web\riaserviceslibrary.web.csproj</linkedserverproject> <riaclientcodegeneratorname>riaserviceslibrary.web.helpers.myservicesentitygenerator</riaclientcodegeneratorname>
.
no matter try, can't seem resolve domainserviceclientcodegenerator
[domainserviceclientcodegenerator(typeof(myservicesentitygenerator),"c#")]
- i got nuget package riaservices.t4 version 4.2.0,
- added references in server side service project microsoft.servicemodel.domainservices.tools.dll microsoft.servicemodel.domainservices.tools.texttemplate.dll
i've included namespaces in code
using microsoft.servicemodel.domainservices.tools; using microsoft.servicemodel.domainservices.tools.texttemplate.csharpgenerators; using microsoft.servicemodel.domainservices.tools.texttemplate;
digging through namespaces, can find domainserviceclientcodegeneratorattribute , idomainserviceclientcodegenerator
can tell me how resolve missing domainserviceclientcodegenerator ?
i spent 4 hours in order working silverlight 5 + ria services sp1 project created in visual studio 2012 + windiws 7 + .net framework 4 in visual studio 2015 + windows 10 in order fix error.
initially not working in visual studio 2015 @ all.
so installed visual studio 2013 (complete type installation) + service pack 5 , less errores.
after installed old silverlight stuff wpf toolkit , after opened solution , unique error
silverlight matchtimeoutinmilliseconds bug : resolve domainserviceclientcodegenerator
so without changes of project properties installed .net framework 4.6.2 preview
and error gone!!!
i compiled fine solution , after able compile under visual studio 2015.
i hope time spent someone.
Comments
Post a Comment