简体   繁体   中英

"Visual Studio has added the full set of dependencies for ASP.NET MVC 5 to project" Can I reverse it?

By mistake I create a MVC 5 Controler instead Web Api 2 Controller in my .NET Web API Project and I received the following message:

Visual Studio has added the full set of dependencies for ASP.NET MVC 5 to project 'PROJECT_NAME'.

The Global.asax.cs file in the project may require additional changes to enable ASP.NET MVC.

  1. Add the following namespace references:

    using System.Web.Mvc; using System.Web.Routing; using System.Web.Optimization;

  2. If the code does not already define an Application_Start method, add the following method:

    protected void Application_Start() { }

  3. Add the following lines to the end of the Application_Start method:

    AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); BundleConfig.RegisterBundles(BundleTable.Bundles);

Is there a simple way to reverse this? Do I have to delete unnecessary files and dependencies one by one manually? Will previously created Api controllers work without changes?

Any help or assistance would be greatly appreciated.

If you're using any form of source control like Git or TFVC you can just undo the changes.

Otherwise, unfortunately, yes to:

Do I have to delete unnecessary files and dependencies one by one manually?"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM