.Net Framework .resx portability to .Net Core -


in .net core there changes apis resource generated resx/designer.cs files need.

specifically type no longer has assembly property directly on it... core gets through type.gettypeinfo().assembly

the result designer.cs files incompatible between frameworks, multi-targeted solution cannot use resource files without compilation failing:

connectiondetails.designer.cs(42,170): error cs1061: 'type' not contain definition  'assembly' , no extension method 'assembly' accepting first argument of type 'type'  found (are missing using directive or assembly reference?) 

visual studio knows how generate these correctly depending on project/solution type, multi-targeted solutions isn't help.

i haven't been able find workaround works both frameworks, since designer.cs generated automatically.

has come solution this?

this a known bug, caused fact visual studio uses first item in targeted-frameworks list purpose of resx code generation. workaround move .net core or .net standard framework first position in targeted-framework list, i.e.

<propertygroup>     <targetframeworks>netstandard1.0;netstandard1.3;net45</targetframeworks> </propertygroup> 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -