How to stop INCORRECT_TYPE_PARAMETER_NUMBER error with Resharper 8.2.1

I get this error from Resharper when I add an abstract generic class to

<configuration> <system.web.webPages.razor> <pages pageBaseType="LegalAudit.Web.WebViewPageBase"> ... 

And the class:

 public abstract class WebViewPageBase<TModel> : WebViewPage<TModel> { // ... } 

It appears from time to time after being in the list of errors β€œIgnore this error”. How to completely get rid of it?

(There is a related question here , but it is not related to resharper.)

Thanks!

+6
source share
2 answers

Creating another non-generic class resolved the error:

 public abstract class WebViewPageBase<TModel> : WebViewPage<TModel> { // ... } public abstract class WebViewPageBase : WebViewPageBase<object> { } 
+11
source

When I add the following to the web.config file, the error disappears, as expected. Reshaper, correctly, wants you to specify a specific implementation of WebViewPageBase :

  <system.web.webPages.razor> <pages pageBaseType="MvcApplication1.WebViewPageBase`1[[TModel]]"> </pages> </system.web.webPages.razor> 

and

 namespace MvcApplication1 { using System.Web.Mvc; public abstract class WebViewPageBase<TModel> : WebViewPage<TModel> { } } 
+2
source

Source: https://habr.com/ru/post/972760/


All Articles