D
D
Dmitry Petrov2018-05-21 09:41:50
ASP.NET
Dmitry Petrov, 2018-05-21 09:41:50

What replaced System.Web in Katana when editing View?

In familiar ASP.NET MVC, when editing views in VisualStudio, MvcWebRazorHostFactory is used.
When a view is opened in the studio, System.Web.WebPages.Razor.dll is loaded and the WebRazorHostFactory factory in the CreateFactory(string typeName) method looks for the view factory.

public class WebRazorHostFactory
    {
...
        internal static Func<string, Type> TypeFactory = DefaultTypeFactory;
...
        private static Func<WebRazorHostFactory> CreateFactory(string typeName)
        {
            Type factoryType = TypeFactory(typeName);
            if (factoryType == null)
            {
                throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture,
                                                                  RazorWebResources.Could_Not_Locate_FactoryType,
                                                                  typeName));
            }
            return Expression.Lambda<Func<WebRazorHostFactory>>(Expression.New(factoryType))
                .Compile();
        }
...
        private static Type DefaultTypeFactory(string typeName)
        {
            return BuildManager.GetType(typeName, false, false);
        }

    }

As you can see, DefaultTypeFactory refers to BuildManager.GetType, which is part of System.Web.
If Katana is an implementation of open OWIN, then what is provided for working with views in Katana? Is it possible to get rid of the dependency with System.Web already?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question