Searching for the phrase "SmartPart File Not Found" on Live Search returns many, many pages. It looks like I was not alone, which is a great feeling to have 🙂
The error seems to appear when users browse to the Web Parts Gallery and try to add a new web part. When adding a new web part, many things are checked for us under the hood. What I know, is that we need to make sure that our assemblies are signed and placed in the GAC and that all their references on Pages and in the Web.Config are good as well as their respective SafeControl entries are correct.
Here, it was the case of the SmartPart and one of its references, System.Web.Extensions. The SmartPart (latest version) found here http://www.codeplex.com/smartpart has a reference to System.Web.Extensions 1.0.61025.0. See below. The shot below was brought to you by .NET Reflector http://www.red-gate.com/products/reflector/
So if you have Ajax 1.0 Extensions and your Web.Config is good, you are probably fine. But if you don’t have those Extensions and have upgraded to ASP.NET 3.5 with Ajax included, and you wanted to use the SmartPart, well, you know the rest. The latest System.Web.Extensions are of version 18.104.22.168.
Given all this good information at my disposal, I can now have a better theory of why this is happening. Due to the fact that we don’t have the earlier Extensions installed and configured, the runtime was firing a File Not Found error. The SmartPart had a reference to the old version of the Extensions, but the system doesn’t. So how can we fix this? Fortunately, we can inform the system (the runtime) that we have a new binding rule for the Extensions assembly. You can find more about this here http://msdn.microsoft.com/en-us/library/2fc472t2(vs.71).aspx
Knowing about binding redirects, I went ahead and made the necessary modifications to the Web.Config file. See below.
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.61025.0" newVersion="22.214.171.124" />
Hope this helps someone out there.