Aspnetcore: "Microsoft.AspNetCore.Mvc.ViewFeatures.Internal" can not find in dotnet core 3.0.0-preview7-27912-14

Created on 27 Jul 2019  路  4Comments  路  Source: dotnet/aspnetcore

After I upgrade my dotnet core 2.2 MVC application to 3.0.0-preview7-27912-14, my custom razor html extesion can not find "Microsoft.AspNetCore.Mvc.ViewFeatures.Internal".

image

And, after "Microsoft.AspNetCore.Mvc.ViewFeatures.Internal" can not find , here is some function I can not use , such as ExpressionHelper and ExpressionMetadataProvider.

image

Here is my example github url : https://github.com/Benknightdark/dotnetcore3v7

area-mvc question

All 4 comments

We've moved all pubternal APIs to be truly internal. https://github.com/aspnet/AspNetCore/issues/4932

You'll need to copy that code over to your project from MVC.

cc @pranavkm @rynowak

@pranavkm - did we create a public version of these APIs?

From https://github.com/aspnet/AspNetCore/issues/8678#issuecomment-475000503

We addressed this particular gap as part of https://github.com/aspnet/Mvc/issues/8724. 3.0 offers a ModelExpressionProvider type that's available from DI and combines the 3 APIs that were previously available:

  • ModelExpressionProvider.GetExpressionText<TModel, TValue>(Expression<Func<TModel, TValue>>)
  • ModelExpressionProvider.CreateModelExpression<TModel, TValue>(ViewDataDictionary<TModel>, string expression)
  • ModelExpressionProvider.CreateModelExpression<TModel, TValue>(ViewDataDictionary<TModel>, Expression<Func<TModel, TValue>> expression)

The latter two return an instance of ModelExpression which is a superset for ModelExplorer that ExpressionMetadataProvider returns. https://github.com/aspnet/Mvc/issues/8724#issuecomment-439285912 has a suggestion for libraries that need to support different versions of AspNetCore.

OK, thanks for your help

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zorthgo picture zorthgo  路  136Comments

pekkah picture pekkah  路  200Comments

kevinchalet picture kevinchalet  路  761Comments

glennc picture glennc  路  117Comments

davidfowl picture davidfowl  路  126Comments