ambiguous calls to methods in MVCControlsToolkit.Controls namespace

Apr 26, 2016 at 5:33 PM
All uses of Html razor helpers defined in the MVCControlsToolkit.Controls give an error stating that their is an ambiguous call to itself.
Examples in a razor view: @Html.DateTimeFor() and @Html.GlobalizationScript() I alternatively tried with a using statement in the razor view WITHOUT any namespace element in any web.config file and no using statement in the razor view and a namespace element in the Views/web.config.
Both situations give the ambiguous error.
If I delete the using statement or namespace element all together I get an error that the method is not defined.

I have a reference to MVC5ControlsToolkit.dll (version 3.0.0.0) in my MVC project and also a reference to MVCControlsToolkit.Business.dll (version 1.0.0.0).
Coordinator
Apr 26, 2016 at 8:03 PM
Maybe your bin directory contains an old version of the MvcControlsToolkit library wchich cause the ambigfuity. Let me know. It appearst to me that this is the only explanation, if you say that the ambiguity appears on ALL of the razor helpers. Infact a TOTAL ambiguity may be explained just with 2 copys of the same library.
Apr 27, 2016 at 7:25 AM
Ah, that is the solution. The NuGet installation installs MVC4ControlsToolkit.dll AND MVC5ControlsToolkit.dll. Both are added as Reference to the project and so both are copied to the bin folder.
I already had deleted the MVC4ControlToolkit reference but forgot to do a Clean to get rid of the dll in bin.
May I suggest that you create a seperate NuGet package for each MVC version? Maybe most developers discover the solution to this puzzle by them selves, by I suppose more new users will lose quite a bit of time finding out the cause.
At a minimum you could add an extra step to the Installation guide.

Thanks



2016-04-26 22:03 GMT+02:00 frankabbruzzese <[email removed]>:

From: frankabbruzzese

Maybe your bin directory contains an old version of the MvcControlsToolkit library wchich cause the ambigfuity. Let me know. It appearst to me that this is the only explanation, if you say that the ambiguity appears on ALL of the razor helpers. Infact a TOTAL ambiguity may be explained just with 2 copys of the same library.

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Johan Stringer

Turbo FrontOffice

Tel: 06 -16809654
Mail: [email removed]
Coordinator
Apr 27, 2016 at 7:54 AM
Edited Apr 27, 2016 at 7:54 AM
Something went wrong with your installation. Usually, a powershell command is executed after the install that autodetects the Mvc version and deletes the other toolkit dll. Probably, due to folder, or file permissions issues something went wrong!

Anyway starting form Mvc6 (or asp.net core Mvc 1) toolkit versions will be completely parallel to Mvc versions. This means that when a new Mvc version is available all toolkit updates will target the new Mvc Version