Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9028173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:55:18+00:00 2026-06-16T06:55:18+00:00

I have activated a WSP file which includes a website template. This works and

  • 0

I have activated a WSP file which includes a website template. This works and I can see the solution int he solution gallery. When I try to create a website, based on that template, its not showing up. But it says “Status: Activated”.

Then I tried to deactivate it and activate it again manually. Out of a sudden, there is a new template showing up, which takes the name of my template appended by a “2”.

So whats happening here exactly? The code to activate my solution is:

System.IO.MemoryStream input = new System.IO.MemoryStream(System.IO.File.ReadAllBytes(rootDirectory + "\\Templates\\Project.wsp"), true);

SPDocumentLibrary solutionGallery = (SPDocumentLibrary)web.Site.GetCatalog(SPListTemplateType.SolutionCatalog);

try
{
 SPFile solutionFile = solutionGallery.RootFolder.Files.Add("Project.wsp", input);
 SPUserSolution newUserSolution = web.Site.Solutions.Add(solutionFile.Item.ID);
}
catch { ... }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:55:19+00:00Added an answer on June 16, 2026 at 6:55 am

    Ok, I found the answer myself and want to share it here. The solution is, not to provide the solution in the catalog, but also to enable the features! It works like this:

    System.IO.MemoryStream input = new System.IO.MemoryStream(System.IO.File.ReadAllBytes(rootDirectory + "\\Templates\\Project.wsp"), true);
    
    SPDocumentLibrary solutionGallery = (SPDocumentLibrary)web.Site.GetCatalog(SPListTemplateType.SolutionCatalog);
    
    try
    {
     SPFile solutionFile = solutionGallery.RootFolder.Files.Add("Project.wsp", input);
     SPUserSolution newUserSolution = web.Site.Solutions.Add(solutionFile.Item.ID);
    
     Guid solutionId = newUserSolution.SolutionId;
    
     SPFeatureDefinitionCollection siteFeatures = web.Site.FeatureDefinitions;
     var features = from SPFeatureDefinition f
                 in siteFeatures
                 where f.SolutionId.Equals(solutionId) && f.Scope == SPFeatureScope.Site
                 select f;
     foreach (SPFeatureDefinition feature in features)
     {
      try
      {
       web.Site.Features.Add(feature.Id, false, SPFeatureDefinitionScope.Site);
      }
      catch { }
     }
    
     SPWebTemplateCollection webTemplates = web.Site.RootWeb.GetAvailableWebTemplates(1033);
     SPWebTemplate webTemplate = (from SPWebTemplate t
                               in webTemplates
                               where t.Title == "Projekt"
                               select t).FirstOrDefault();
     if (webTemplate != null)
     {
      try
      {
       web.Site.RootWeb.ApplyWebTemplate(webTemplate.Name);
      }
      catch { }
     }
    }
    catch { ... }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have activated the IIS package for windows, and, I created an index.html file
This query that I have is returning therapists whose 'therapistTable.activated' is equal to false
In my .emacs file, I have (setq transient-mark-mode nil) and yet transient-mark-mode is activated
I have activated proguard in my project since I am trying to release this
My wordpress 3.4.2 site have 25 activated plugin, so Which is safest way to
I have activated TDO Mini Forms plugin and using the shortcode in my template
Say I have a mobile optimized website which runs with a lot of javascript
I have this Makefile that has a variables named MODULES which lists all the
while running: rake snorby:setup getting below error: rake aborted! You have already activated rake
I have a java method activated by a mouse click on a button private

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.