Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get EnumMember to work in ASP.net 5 with Visual Studio 2015

I have the released version of Visual Studio 2015 and ASP.NET 5 Beta 6 installed. I am trying to convert an existing web site to the new ASP.net and have a simple enum for US states where I use EnumMember for the state full name.

Problem is that I need System.Runtime.Serialization for this and I tried including it in the project.json without any luck. All the hits I get on the web are from the VS 2015 beta from last year.

I added "System.Runtime.Serialization": "4.0.10.0" to the dependencies section, but I get an compile error DNX 4.5.1 error : The dependency System.Runtime.Serialization >= 4.0.10.0 could not be resolved.

What am I missing? It used to be easy to add system references, so I must be missing something. The intellisense helped with the name, but did not give any help with the version.

like image 696
Tyrel Van Niekerk Avatar asked Aug 14 '15 17:08

Tyrel Van Niekerk


1 Answers

Right click on your project -> Add -> Reference.. -> Assemblies -> Mark System.Runtime.Serialization (i have 4.0.0.0 version ) -> Ok

like image 93
Dima Adas Avatar answered Nov 03 '22 19:11

Dima Adas