I am trying to install a Sitecore site on a QA server and I am getting a very strange error that I can't figure out. Basically what I did was first a clean install of Sitecore 8.1. I verified that was working. Then I simply copied all of our custom code in to the site. This includes all of our renderings, all of our custom DLLs and our custom config files. Sort of the normal stuff you would expect when deploying custom code for a Sitecore instance. Our site also has a custom Global.asax that inherits from some custom code of ours. So when I try to open up the site I see the following error:

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'MyProject.Web.Global'.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="MyProject.Web.Global" Language="C#" %>

Source File: /global.asax Line: 1

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274

For some reason it seems like .NET can't find the assembly for my project which is definitely in the BIN folder like it should be. I have Googled this and found all kinds of solutions that just say things like "try re-copying all of your code". I have done that a number of times with no luck. I feel like I must be missing something very basic. Any ideas?

  • Which .net version is installed on the QA server? Is it the same or higher as your code is built against? Nov 15 '16 at 14:37
  • do you have the custom type in the Global.asax.cs file? Can you check if it is present in the Website folder as well? Nov 15 '16 at 14:42
  • @MarekMusielak - here's the strange thing. In Visual Studio the target framework is .NET 4.5 and the app pool on the server is .NET 4.0. However this is the second web site on the server. We actually have two instances of Sitecore on this server. One is 7.5 and the other is 8.1. And we have two instances of our code base - one built for 7.5 and the other built for 8.1. Both code bases are built with the target framework of .NET 4.5. So I can't figure out why the 7.5 instance works fine but the 8.1 instance does not. Nov 15 '16 at 14:57
  • Your Global class probably inherits from something else, say Sitecore.ContentSearch.SolrProvider.StructureMapIntegration.StructureMapApplication. The runtime is probably not able to locate this type in any of the available binaries, which means you're missing some Sitecore binary. I would recommend doing a BeyondCompare between a known good instance and the one you're trying to launch. Nov 15 '16 at 15:05

Thanks to Justin Laster and Marek Musielak I figured it out. Yes my Global class did inherit from Sitecore.ContentSearch.SolrProvider.UnityIntegration.UnityApplication. And I went and got the Solr Support zip file for 8.1 from Sitecore and copied them in to the BIN folder, and then it worked. So I think I must have had an older list of Solr support files in my BIN folder. So now it is working. Thanks so much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.