I ran into this slight annoyance today while doing a Web Deploy. For the four months that I’ve been working on this project I’ve been publishing to my sitecore instance in the wwwroot folder and have had no issues. Today I created another empty folder to deploy to as I just wanted to the files that the client would need to deploy. Unfortunately as soon as I changed the output directory I started getting this error:
Sitecore Error: Could not load type 'Sitecore.Web.Application'
The first thing I did was check my references as I knew there was one with a yellow exclamation I had been putting off dealing with. Sure enough, it was Sitecore.Web.dll. So I removed it from the project, found the correct DLL in the sitecore instance’s DLL folder, copied that into the project’s references folder and added it back to the project. That should be all, right?
Nope.
I was stil running into the same error. It would build fine, but not deploy. So I tried setting the Sitecore.Web.dll to Copy Local = true and that alone did not fix it. I then set the same setting on the Sitecore.Kernel.dll and then I was able to publish to an empty directory.
I just wanted to share that quick solution as I only had two hits for that error and both of their solutions were a fair bit different from mine. It’s a bit of a frustrating nuance of Sitecore for me as you are always directed to set Copy Local = false during the initial setup of a project. That also seems to lead to other issues for me such as my intellisense not working.
A seasoned Senior Solutions Architect with 20 years of experience in technology design and implementation. Renowned for innovative solutions and strategic insights, he excels in driving complex projects to success. Outside work, he is a passionate fisherman and fish keeper, specializing in planted tanks.