0

My problem is as follows. I've tried to install the latest version of Microsoft.AspNet.WebApi.HelpPage.5.2.3 but I always get "Install failed. Rolling back"

I'm using Visual Studio 2012 Professional and WebAPI 2.2 with .NET Framework 4.5. I've searched for solutions to fixed the problem but nothing helped. I can't start my API using HTTP Requests. When I installed EnableCors I got the problem.

Here's the error message:

..\Areas\HelpPage\XmlDocumentationProvider.cs(14,18,14,42): error CS0535: 'WebApi.Areas.HelpPage.XmlDocumentationProvider' does not implement interface member 'System.Web.Http.Description.IDocumentationProvider.GetDocumentation(System.Web.Http.Controllers.HttpControllerDescriptor)'.

..\Areas\HelpPage\XmlDocumentationProvider.cs(14,18,14,42): error CS0535: 'WebApi.Areas.HelpPage.XmlDocumentationProvider' does not implement interface member 'System.Web.Http.Description.IDocumentationProvider.GetResponseDocumentation(System.Web.Http.Controllers.HttpActionDescriptor)'.

Community
  • 1
  • 1
yuro
  • 2,189
  • 6
  • 40
  • 76
  • possible duplicate of [Error when upgrading to WebAPI 2.1 XmlDocumentationProvider does not implement interface member GetDocumentation](http://stackoverflow.com/questions/22295078/error-when-upgrading-to-webapi-2-1-xmldocumentationprovider-does-not-implement-i) – Tom May 27 '15 at 17:14
  • @Tom I've tried the solution of this thread but I've still the error. – yuro May 28 '15 at 07:30

1 Answers1

0

I've solved my problem. I'm approached as follows:

Firstly I've opened a command prompt and navigated to the following path: C:\Program Files (x86)\Common Files\microsoft shared\MSEnv then I typed the command regsvr32 VsLangproj.olb. Here is a helpful thread https://nuget.codeplex.com/workitem/3609

Afterwards I've managed the nuget packages when you go on TOOLS -> Nuget Package Manager -> Manage Nuget Packages for project maps and updated the following packages:

ASP.NET MVC 5.2.3

ASP.NET Razor 3.2.3 ASP.NET WebAPI 2.2 Client Libraries 5.2.3

ASP.NET WebAPI 2.2 Core Libraries 5.2.3

ASP.NET WebAPI 2.2 Cross-Origin-Support 5.2.3

ASP.NET WebAPI 2.2 HelpPage 5.2.3

ASP.NET WebAPI 2.2 Tracing 5.2.3

ASP.NET WebAPI 2.2 Web Host 5.2.3

ASP.NET WebPages 3.2.3

Thirdly I've configured the following lines in the root Web.config of the WebAPI Project.

<dependentAssembly>
  <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>

And the last change was in the Views/Web.config of the project:

<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
  <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>

Here I've changed the Version of Razor from 2.0.0.0 to 3.0.0.0 and now the API runs without problems! This thread was very helpful Site stopped working in asp.net System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to

Here is an exactly description how to update the MVC4 to MVC5: http://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2

I hope the post is helpful for other users.

Community
  • 1
  • 1
yuro
  • 2,189
  • 6
  • 40
  • 76