1

Closed

warning CS0436: The type 'T4MVCHelpers' in ... conflicts with the imported type 'T4MVCHelpers' in ... Using the type defined in ...

description

This issue is similar to the issue that was once around with Extensions. It happens if you reference a DLL (project) that had T4MVC included and compiled.

Is it possible to introduce a setting which could prevent doubling the T4MVCHelpers static class?
Closed Feb 1, 2013 at 12:18 AM by davidebbo
Ok, I made that change. Available in T4MVC 3.4.1 on nuget.

comments

davidebbo wrote Jan 31, 2013 at 10:25 PM

Ah right, that's the one class that's still generated. I wonder if we could just make it internal, since I think those methods are only meant to be called from within the assembly itself.

Can you give that a try? Just change it in your T4MVC.tt.hooks.t4.

markoh wrote Jan 31, 2013 at 10:54 PM

Tried it, generates T4MVC.cs with T4MVCHelpers internal but the same warning remains at compilation.

markoh wrote Jan 31, 2013 at 11:14 PM

Right, it works if I change it to internal in the project that I am including. Previously, I only changed it in the project that was consuming the other project (both of which had T4MVC added via NuGet).

davidebbo wrote Jan 31, 2013 at 11:28 PM

Right, it would need to be changed everywhere. Try to play around with that, and if everything seems good, maybe we can just make that change in T4MVC.

markoh wrote Feb 1, 2013 at 12:25 AM

Seems to work fine and I don't see how it could go wrong if we change it. Each module that uses T4MVC essentially creates its own internal helpers. I think that's reasonable.