Can I ignore all the warnings ?

Sep 11, 2013 at 6:59 PM
New to T4MVC, love it and using it with MVC4.

I get a lot of warning messages, is that normal ? Messages such as

__HomeController.ActionNameConstants' hides inherited member ActionNameConstants'. Use the new keyword if hiding was intended.
__

I assume this is ok ?

Secondaly how can i turn off these warnings but I do not want to turn off warnings globally ..just t4mvc

Thanks

Jay
Coordinator
Sep 11, 2013 at 7:46 PM
I don't think I've run into this. Can you try my test app https://github.com/davidebbo/T4MVCSampleApp to see if you see that as well there? If not, then we'll need to identify what's different about yours that triggers that.

David
Sep 11, 2013 at 8:18 PM

David

I tried your code and got the following errors

Error 4 A namespace cannot directly contain members such as fields or methods C:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.cs 1 1 T4MVCSampleApp

Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration c:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.tt 1 1 T4MVCSampleApp

Error 2 Compiling transformation: Method must have a return type c:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.tt 1 6 T4MVCSampleApp

Error 3 Compiling transformation: Type expected c:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.tt 1 12 T4MVCSampleApp

How ever when I removed T4MVC package and added the one you have on NuGet , your demo worked

I am still trying to see why I am getting all those warnings on my code

Jay

Sep 11, 2013 at 8:30 PM
I took a new NuGet copy and I still get the following

Warning 10 'WebApp.Controllers.HomeController.Views' hides inherited member 'WebApp.Controllers.BaseController.Views'. Use the new keyword if hiding was intended. F:\Dev\Sample\HomeController.generated.cs 101 27 SampleWebApp
    public ViewsClass Views { get { return s_views; } }
    [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
Jay
Coordinator
Sep 11, 2013 at 8:32 PM
Do you mean you get this with my test app, or with your app?
Sep 11, 2013 at 8:35 PM
David

I tried your sample app and got the following errors

Error 4 A namespace cannot directly contain members such as fields or methods C:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.cs 1 1 T4MVCSampleApp

Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration c:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.tt 1 1 T4MVCSampleApp

Error 2 Compiling transformation: Method must have a return type c:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.tt 1 6 T4MVCSampleApp

Error 3 Compiling transformation: Type expected c:\Users\Jay\Desktop\T4MVCSampleApp-master\T4MVCSampleApp\T4MVC.tt 1 12 T4MVCSampleApp


How ever when I removed T4MVC package and added the one you have on NuGet , your demo worked

Jay
Coordinator
Sep 11, 2013 at 8:47 PM
Those errors might have just been a temporary glitch, such that just rerunning the T4MVC custom tool would have fixed it. In any case, it's unrelated to the warning you're seeing, which at this point is still mysterious.