Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Recently I was working on a sandboxes solution, which included a WebTemplate (Vesa "Vesku" Juvonen wrote a really nice post about it), but I couldn't deploy it, the followin error was displayed into Visual Studio 2010:

Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E

 After checking the Logs (in %SHAREPOINT ROOT%\\LOGS) the following error was found:
Failed to open the file 'Features\AD6.Public_AD6_Web\AD6PublishingSite\onet.xml'. 
#2006e: The specified path "" does not exist. 
Failed to read file "Features\AD6.Public_AD6_Web\AD6PublishingSite\onet.xml" from feature id "6f87a30b-b785-4483-a1f4-25a1150ebda4". 

After comparing that location to the supposed deployment location, I found out why the error was generated: the onet.xml was deployed to another location:

Instead of "Features\AD6.Public_AD6_Web\AD6PublishingSite\" the onet.xml was deployed to "Features\AD6.Public_AD6_Web\AD6Publishing". But why? A "Find" (ctrl+shift+f) on "AD6PublishingSite" scoped to the complete solution, gave me one single result. The name of the webtemplate was the exact match:

After changing the webtemplate name to "AD6Publishing" (or changing the Module name to AD6PublishingSite"), I was able to deploy the solution correctly.

Lessons learned: the webtemplate name and it's module it resides in, require you to have the same name!

Published Fri, Jan 14 2011 9:28 PM by Bas

Comments

# SharePoint 2010: Error 'Add Solution': Exception from HRESULT: 0x8107026E" al desplegar un Web Template!

Friday, March 18, 2011 11:49 PM by Blog del CIIN

Este error tan bonito fue el que tuve el otro día cuando estaba creando una Web Template para SharePoint

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Thursday, May 19, 2011 5:21 PM by koskila

Great post! This solved my problem, it never really occurred to me that the default deployment location could be wrong but it was int the wrong feature's directory.

Thanks!

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Friday, July 08, 2011 12:54 PM by Daniel

Thank you very much!

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Tuesday, November 15, 2011 9:11 PM by Mark

I had a similar issue, but my onet.xml file was not set to a Deployment Type of ElementFile in the properties.

# Thanks!

Wednesday, February 08, 2012 7:46 PM by Shawn

Thanks for this one! This solved my issue.

Good catch.

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Monday, February 13, 2012 10:32 AM by Kroft

Thanks this really helped me out!

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Monday, February 13, 2012 1:17 PM by Itay Shakury

Thank you!!!

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Friday, March 09, 2012 1:06 PM by Tuomas

Thanks! Saved my day!

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Wednesday, April 11, 2012 8:14 AM by Lars Martin Bredal

Excellent write-up!

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Monday, August 13, 2012 2:29 PM by sagar

was useful

# re: Error when deploying WebTemplate: "Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E"

Tuesday, February 12, 2013 11:23 AM by Anil

Thanks a lot...hit the bird's eye

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Please add 3 and 7 and type the answer here: