I was in the process of implementing Telerik's Kendo UI for ASP.NET MVC into a mixed ASPX / MVC 4 application when I ran into a problem that stopped me dead in my tracks for longer than I care to admit. Here is the main portion of the error message:
Server Error in '[my]' Application.
Entry point was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.EntryPointNotFoundException: Entry point was not found.
(refer to the bottom of this post for the full error message)
Since the assemblyBinding section definitely was there, I could only deduce that ASP.NET was ignoring it for some reason. To test my theory I intentionally misspelled some of the tags in the assemblyBinding section and refreshed my test web page. My suspicion was confirmed when IIS didn't choke on the misspelling,
So why was ASP.NET ignoring the assemblyBinding section? I'd already confirmed (more than once) that the assemblyBinding config section was properly positioned and formatted within the config. In fact, the section had been added quite a while before with an assembly binding for something unrelated to Kendo. So I went back to Binging and Googling, and in short order StackOverflow saved the day.
The StackOverflow question was "Why is assembly binding redirect not working on my web site?", and one of the first things the post author stated was "I have already removed the xmlns='http://schemas.microsoft.com/.NetConfiguration/v2.0" attribute from the root configuration element."
I hadn't done that. In fact, I wasn't even sure if my root configuration element had that attribute set. Once more I opened Web.config, and I'll be darned if my root configuration tag didn't have exactly what the StackOverflow user had removed from his.
I purged the xmlns='http://schemas.microsoft.com/.NetConfiguration/v2.0" attribute from my root configuration element, clicked refresh on my test page, and to my great relief the "Entry point was not found" error was nowhere to be found.
Lessons learned?
So why was ASP.NET ignoring the assemblyBinding section? I'd already confirmed (more than once) that the assemblyBinding config section was properly positioned and formatted within the config. In fact, the section had been added quite a while before with an assembly binding for something unrelated to Kendo. So I went back to Binging and Googling, and in short order StackOverflow saved the day.
The StackOverflow question was "Why is assembly binding redirect not working on my web site?", and one of the first things the post author stated was "I have already removed the xmlns='http://schemas.microsoft.com/.NetConfiguration/v2.0" attribute from the root configuration element."
I hadn't done that. In fact, I wasn't even sure if my root configuration element had that attribute set. Once more I opened Web.config, and I'll be darned if my root configuration tag didn't have exactly what the StackOverflow user had removed from his.
I purged the xmlns='http://schemas.microsoft.com/.NetConfiguration/v2.0" attribute from my root configuration element, clicked refresh on my test page, and to my great relief the "Entry point was not found" error was nowhere to be found.
Lessons learned?
- Submit the support ticket sooner. The hours I spent spinning my wheels before I submitted the support ticket wouldn't have been necessary if I'd submitted the support ticket right after I verified that I'd done everything as Telerik instructed.
- Don't assume that something is working just because it's already in the code or the config file. My Web.config file already had an assemblyBinding section in it before I added the bindings specified for Kendo. It didn't cross my mind that the section may have only been put in the config to drive me nuts later....
- Keep code and config files clean! Dead, deprecated or test code should be removed, or at least clearly commented if it needs to be left in for some reason. Developers that refactor the code later will thank you!
I already had MVC 4 playing nicely within my ASPX web project, and I had followed Telerik's step-by-step Kendo UI for ASP.NET MVC installation instructions exactly. I had no idea what I'd done wrong. I just knew from the call stack that Kendo was choking on a call to System.Web.Mvc.
I combed through my Web.config file. I examined the Kendo.MVC.dll's manifest and triple-checked my project's DLL references and my computer's GAC to make sure that all the right versions of all the needed DLLs were available. I Googled. I Binged. I prayed. Really. Finally I did what I probably should have done much sooner: I submitted a support ticket to Telerik.
The answer wasn't as helpful as I hoped:
The answer wasn't as helpful as I hoped:
This exception is thrown when the assembly binding configuration that is described in the configuration is not added. Please verify that the configuration is included correctly in the main Web.config file. There are not any other known reasons for this exception and if the problem persists, please send a small runnable sample so I can investigate further.
Waaaaaahhhh! My Web.config file already had the "assembly binding configuration" that Telerik told me to put in it, and I wasn't particularly keen on trying to create a "small runnable sample" for the support tech. I figured that would take a long time (the existing project I was integrating Kendo into is very large and complex), and I was afraid I might not even be able to recreate the problem in a sample project.
As I pondered what to do next, it dawned on me that the Telerik support tech might have given me the key to solving the problem: "There are not any other known reasons for this exception...."
Hmmmm... I had added the specified dependent assemblies to an existing "assemblyBinding" section in my Web.config:
As I pondered what to do next, it dawned on me that the Telerik support tech might have given me the key to solving the problem: "There are not any other known reasons for this exception...."
Hmmmm... I had added the specified dependent assemblies to an existing "assemblyBinding" section in my Web.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Here is the full error message:
Server Error in '/Sentry2010' Application.
Entry point was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.EntryPointNotFoundException: Entry point was not found.
Source Error:
|
Source File: c:\Develop\Solutions\Application\src\My.Application\View\Web\View.Web\Areas\ApplicationReporter\Views\ReporterSets\ReporterSets.cshtml Line: 12
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929