Mvc icon indicating copy to clipboard operation
Mvc copied to clipboard

Newtonsoft.Json version mismatch from services.AddMvc

Open kili0fi opened this issue 10 years ago • 3 comments

In ConfigureServices i call

                services.AddMvc()
              .AddJsonOptions(opt =>
              {
                  opt.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
              });

That AddMvc always fails to load Newtonsoft.Json 7.0 . It seems that everything else uses Json 8.0.3, except Microsoft.Extensions.DependencyModel/1.0.0-rc2-final, which has dependency to 7.0.1 , which AddMvc uses via Microsoft.Extensions.DependencyInjection.

The project references windows libraries which in turn use COM, so the solution is targeted to 32bit windows. Is there any chance to ever get RC2 to work around this?

kili0fi avatar Jun 20 '16 14:06 kili0fi

Binding redirects should be generated for your project automagically. You'd need to provide a sample. Are you referencing a csproj?

davidfowl avatar Jun 20 '16 15:06 davidfowl

In the solution I am referencing a csproj dll, which in turn references COM objects and encapsulates them. Chain of dependency is: asp.net core service (.json project) -> .net library (csproj) -> COM dll.

Making a sample would take time. Before committing that time, i am asking, would that make any difference any more into RC2?

kili0fi avatar Jun 20 '16 16:06 kili0fi

This is no longer an issue in RTM.

kili0fi avatar Jul 02 '16 09:07 kili0fi