Activate web publishing feature problem

I am trying to use the object model to activate the site collection publishing feature, and the web publishing feature on a new site. Here is a snippet of my code.
using (SPSite site = new SPSite(SiteUrl))
using (SPWeb web = site.OpenWeb())
//Activate the publishing feature at the site collection level (PublishingSite)
site.Features.Add(new Guid("F6924D36-2FA8-4f0b-B16D-06B7250180FA"));
//Activate the publishing feature at the web level (PublishingWeb)
web.Features.Add(new Guid("94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB"));
The problem is I get an error that says "The SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated."
I have browsed to the site and verified the Publishing feature is activated at the site collection level. I have double checked that the GUIDs are correct. Does anyone have an idea why I am getting this error and cannot activate the publishing feature on
the web level?

Hi
Did you try like this, I meant adding allowunsafeupdates
using (SPSite site = new SPSite(SiteUrl))
using (SPWeb web = site.OpenWeb())
{ site.AllowUnsafeUpdates = true;
//Activate the publishing feature at the site collection level (PublishingSite)
site.Features.Add(new Guid("F6924D36-2FA8-4f0b-B16D-06B7250180FA")); site.AllowUnsafeUpdates = false; web.AllowUnsafeUpdates = true;
//Activate the publishing feature at the web level (PublishingWeb)
web.Features.Add(new Guid("94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB")); web.AllowUnsafeUpdates = false;
Please remember to click 'Mark as Answer' on the answer if it helps you

Similar Messages

  • HP Smart Web Printing feature, problem with IE7 and FireFox3

    "HP Smart Web Printing" problem with Internet Explorer 7 and FireFox 3I have a laptop that came with: Windows Vista Home Premium, Internet Explorer 7, FireFox 1.9. Everything worked fine.
    Recently I bought a "HP Photosmart C4580 All-in-One" printer that came with a free software "HP Smart Web Printing".
    Smart Web Printing worked fine with FireFox 1.9 browser. I liked it very much, because with it, I could print only the portions from the web page that I want, thus saving on inks. It really does more than that.
    With IE 7, Smart Web Printing was a disaster. IE 7 stopped working. Every time I closed a web browser window, IE7 would stop working and start all over again. It happened all the time.
    On suggestion from Microsoft Windows help desk I "Reset IE Setting". This solved the IE 7 problem , but it also removed the Smart Web Printing feature.
    Next, one day I downloaded latest version of FireFox browser "FireFox 3". Once again I lost the Smart Web Printing Feature, because it was not compatible with FireFox 3.
     Now here I am with no "Smart Web Printing" feature at all.
     Any suggestion how can I get "Smart Web Printing" feature back. I love the feature
    Thanks

    March 27th 2009 I've just downloaded HP Smart Web Print onto an HP a6500f desktop system running Vista-64.  I first installed it as a limited user and I get no icon in the IE7 taskbar.  I examined the manage add-ons dialog and it was installed but the toolbar configuration has no control icon for SWP icon.
    Then I logged off and logged on as a privileged user and downloaded again and tried to install.  This 2nd installation actually REMOVED my first installation.
    So I then downloaded for a third time and installed and it finished installing but there was no SWP icon in the tool bar.  I examined the Manage Add-Ons dialog and saw one in there on the left side.  I transfered the inactive icon to the active side of the dialog and then I immediately had TWO SWP icons in the task bar. (*mumble grumble*).  So I removed one and all is OK now as long as I use the IE7 as a privileged user. 
    If I go back to being a limited user (not an unreasonable thing to do is it?) I don't have an SWP icon.  Trying to install SWP application again only cause it to want to remove the existing installation.
    I'm not very impressed with this behavior. 
    Is there anything that can be done to get SWP to work for limited users?

  • The SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated.

    Hi All,
    I am trying to activate the Publishing feature for a SharePoint website using a custom Site Definition File. The problem I am getting
    is when I try to use the custom site template I get an error message:
    New-SPSite : The SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated.
    The custom
    Site Definition File snippet is show below:
    <?xml
    version="1.0"
    encoding="utf-8"?>
    <Project
    Title="SiteDefinition1"
    Revision="2"
    ListDir=""
    xmlns:ows="Microsoft
    SharePoint"
    xmlns="http://schemas.microsoft.com/sharepoint/">
      <NavBars>
      </NavBars>
      <Configurations>
        <Configuration
    ID="0"
    Name="SiteDefinitionDelegateControls2">
          <Lists/>
          <SiteFeatures>
            <!--Document
    Set-->     
            <Feature
    ID="{3bae86a2-776d-499d-9db8-fa4cdc7884f8}"
    Name="FeatureDefinition/15/3bae86a2-776d-499d-9db8-fa4cdc7884f8"
    />
            <!--Publishing
    Prerequisites-->     
            <Feature
    ID="{a392da98-270b-4e85-9769-04c0fde267aa}"
    Name="FeatureDefinition/15/a392da98-270b-4e85-9769-04c0fde267aa"
    />
          ...Other Site Features
          </SiteFeatures>
         <WebFeatures>
            <!--2
    Publishing Web-->
         <Feature
    ID="{94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb}"
    Name="FeatureDefinition/15/94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb"/>
         ... Other Web Features
          </WebFeatures>
          <Modules>
            <Module
    Name="DefaultBlank"
    />
          </Modules>
        </Configuration>
      </Configurations>
      <Modules>
        <Module
    Name="DefaultBlank"
    Url=""
    Path="">
          <File
    Url="default.aspx">
          </File>
        </Module>
      </Modules>
    </Project>
    I hope you can help
    Colin

    As the error says.  The Publishing Infrastructure feature must be activated at the Site Collection level where you are creating a new site PRIOR to turning on the Publishing feature.  So if you are trying to use this site definition to create a
    new Site Collection then its not going to work.  If you are trying to create a sub site then make sure that Publishing Infrastructure is enabled in the site collection before trying to create a sub site with this site definition.
    Internally Microsoft does this for the Publishing Portals using custom code.  Here's an article that discusses how to do it in SharePoint 2010.  
    http://msdn.microsoft.com/en-us/library/office/gg615465(v=office.14).aspx
    Compare what's in the article to one of the Publishing templates available out of the box in 2013 and you should be able to find the assembly that is used to load the Publishing features.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Error activating publishing feature

    Hello... im having a problem while i try to activate the publishing feature, i get this error
    The field {51d39414-03dc-4bd0-b777-d3e20cb350f7} defined in feature {aebc918d-b20f-4a11-a1db-9ed84d79c87e} is founded in site collection or in a subsite
    I maked a program to read all the guid of fields in the sites and list,, and dont found {51d39414-03dc-4bd0-b777-d3e20cb350f7}, thanks in advance

    Hi Diego,
    If you have already activated the Site Collection feature SharePoint Server Publishing Infrastructure prior to activating the Site Feature SharePoint Server Publishing then run: stsadm -o activatefeature -id
    AEBC918D-B20F-4a11-A1DB-9ED84D79C87E -url
    http://YourWebApp.com -force.. This will force the feature to be installed..
    The field PublishingStartDate is an element of the feature Asset Library 
                <Field ID="{51d39414-03dc-4bd0-b777-d3e20cb350f7}"
                    Name="PublishingStartDate"
                    StaticName="PublishingStartDate"
                    SourceID="http://schemas.microsoft.com/sharepoint/v3"
                    Group="$Resources:cmscore,group_publishingcolumns;"
                    DisplayName="$Resources:cmscore,column_startdate_displayname;"
                    Type="PublishingScheduleStartDateFieldType"
                    Required="FALSE" CanToggleHidden="TRUE"
                    Sealed="TRUE"
                    StorageTZ="UTC">
                </Field>
    The Asset Library is an element of the the feature Publishing Resources and a prequisite of the feature Publishing Site
    <Feature  Id="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E"
              Title="Publishing Resources"
              Description="Enable Publishing for site collection."
              Version="14.0.3.0"
              Scope="Site"
              Hidden="TRUE"
              DefaultResourceFile="core"
              ReceiverAssembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
              ReceiverClass="Microsoft.SharePoint.Publishing.PublishingResourcesFeatureHandler"
              xmlns="http://schemas.microsoft.com/sharepoint/">
    -Ivan
    Ivan Sanders My LinkedIn Profile,
    My Blog,
    @iasanders.

  • ICal Web Publishing Error, UK time change

    We publish booking availability for our village hall via ical onto the hall's website.
    During October 2010 the " We're Sorry" Apple error message was encountered and put down to problems associated with the UK summer/winter time change.
    The problem then disappeared for some weeks - the calendar published to the web site without a hitch.
    Now it has re-occurred.
    Have Apple made a decision to remove the web publishing feature or is it just another technical hitch?

    Hey Christos,
    I'm not sure if that is possible  with the plugin, but I will double check. If you are just looking to do some basic monitoring and control, using a web service might be better suited in this case, since it is lighter and can serve actual web pages instead of relying on a plugin. Feel free to check out our Web development community group, try some of the examples, and post to our discussions: https://decibel.ni.com/content/groups/web-services
    Daniel C.
    Applications Engineer
    National Instruments

  • Please specify how do we can activate a web scope feature over all sub webs when a solution package is activated.???

    please specify how do we can activate a web scope feature over all sub webs when a solution package is activated.
    when a solution package is deactivated the web scope features over all sub website gone deactivated and does not re-activated when solution package is activated.
    we have couples of sub webs to activate web features manually that should be activated when a solution package is activated.
    all sub webs are created by custom web templates onet.xml.

    Hi,
    I can think of three different solution (all custom solution)
    Use Powershell Cmdlet to activate feature to all sub sites
    Upgrade your solution to Site Collection scope, However all subsites under the root will have access to the features, which you may want to restrict based on your requirement
    create a site scoped solution feature to activate the web scoped features, this will give you more control and easier management of all your features
    here are some links -
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/10a95745-67c5-4a32-a783-b9ae8977f7e0/deploying-a-solution-with-a-feature-to-be-activated-on-a-number-of-subsites?forum=sharepointdevelopmentprevious
    http://sharepointgroup.wordpress.com/2012/05/04/activating-and-deactivating-features-with-powershell/
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Filemaker web publishing / port 80 problem

    Since installing OS X Server a few months ago, I've gotten reports of remote users not being able to access our web-published Filemaker database. Or rather, the only browser that will currently display our web-published DBs properly is Safari.
    The problem: in any browser other than Safari (I should mention our remote users run Windows XP with IE 6), port 80 is removed from the URL when the user hits enter/commits the URL. The result is a blank page with the Filemaker header image...
    I've scanned our Web server settings, Filemaker's web publishing engine, and our LAN firewall for clues, but nothing seems amiss. Any ideas?

    Sounds like something is not quite right with your firewall.
    I don't get why your need to add :80 to the url for your server in the first place. Are you able to advise why you need to?
    What do you see if you go to http://yourserver.com:80 and http://yourserver.com (rather than with the /fmi/iwp/... added)?
    I assume port forwarding is turned on for port 80 to forward to your FMPro server? This might be a good place to start poking for things that are not quite right.
    hth,
    b.

  • Is it possible to set up device channels in Team site if I activate publishing feature?

    Hi All,
    Is it possible to create device channels for my team site. I inadvertently created this as team instead of Publishing site. Please advise.
    Dinesh

    Hi Dinesh,
    If you want to access SharePoint 2013 out-of-box device channel then it requires SharePoint Publishing Features at site collection, please enable SharePoint
    Server publishing site infrastructure in team site
    Other Approach:
    Device channel work with "User Agent Strings", you can read browser user agent string at run time and apply custom master page/CSS, however you need to do customize master page/CSS for all devices
    The User Agent String as I’m sure we all know identifies which browser you are using to connect with it is sent from the Client to the Server within the initial headers and contains certain tokens like Operating System, Browser, etc.
    reference : http://blogs.technet.com/b/christwe/archive/2012/11/02/sharepoint-tidbit-sharepoint-2013-device-channels.aspx
    If my contribution helps you, please click Mark As Answer on that post and
    Vote as Helpful
    Thanks, ShankarSingh(MCP)

  • Ran into a problem by activating the SharePoint Server Publishing feature

    By activating the "SharePoint Server Publishing feature"  at site level the complete look and feel of the site has been changed to a default page layout , all the customization's were removed.
    Changes were not rolled back even after deactivating the feature.
    any help on how to get back my look and feel is appreciated.
    Thanks in advance.
    Regards
    Bhaskar
     

    Hi,
    How did you customize the site initially? Was that in SharePoint designer? And if so what part of it did you exactly customize? The page itself or the masterpage?
    Regards,
    Casper

  • The Specified name is already in use while activating Publishing feature at site collection level in Moss2007

    Hi,
    Please suggest on this "The Specified name is already in use while activating Publishing feature at site collection level in Moss2007"
    The specified name is already in use.
    A list, survey, discussion board, or document library cannot have the same name as another list, survey, discussion board, or document library in this Web site.  Use your browser's Back button, and type a new name.   at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateList(String
    bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)
       at Microsoft.SharePoint.Library.SPRequest.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)  

    there are some OutBox list/libraries being created when you activate publishing features, make sure those names not being used: check this post for more detail..
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/f7e93d26-c2a1-42c2-b191-dc48f734684b/the-specified-name-is-already-in-use-error?forum=sharepointgenerallegacy
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Turn off publishing feature without messing up the SharePoint site

    Hi,
    Is it possible to turn off the publishing feature (after it was turned on), without goofing up the SharePoint site and creating problems?  I want to save a site as a template and just discovered that that option is not available when publishing is enabled. 
    Why does Microsoft make these decisions arbitrarily?  Ugh!
    Thanks! Patti N.

    There are many ways to tweak and achieve the target i.e. saving publishing site as template, but if you try creating a new site using that template on a non-publishing site, it will surely gonna fail with some generic error
    Even if you deactivate the ft and then save site as template, it will fail when you try creating another site using that template on a non-publishing site. So basically, it can only create a new site using that template only if the destination site have
    the publishing ft activated
    SharePoint does not support Save Site as Template option with the Publishing features turned on. The supported method to create templates for publishing sites is to use a site definition template and using a feature XML.
    Please refer:
    https://support.microsoft.com/kb/2492356?wa=wsignin1.0
    To answer your question, Why does Microsoft make these decisions arbitrarily?
    when you activate the Publishing ft is the ability to use Web Content Management and create custom Page Layouts and change the way you can mange and display the information.You can manage Content and how this content will be shared to all users, you can
    work with Content types and associate with Pages to change and categorize you information and display to public, i use for SharePoint internet Site because is a very easy way to users create new content and display to public this information, there
    another features you can use with publishing feature like active the Output Cache this feature will improve performance in the page load because the webpart, metadata and page will be stored in cache, you can also define if you want to manage the
    profiles for this cache, anonymous access or authenticated users.
    All these changes happen when you activate publishing ft and wont get revert when you deactivate the feature, Hence it is not possible
    To know more about publishing ft, please refer
    https://technet.microsoft.com/en-us/library/ff628963(v=office.14).aspx

  • List View Web Part Search problem

    We have a problem with the search in the
    List View Web Part (SearchBox).
    If you enter anything in SearchBox
    and the beginning of the search, nothing happens.
    This problem only occurs in non-admins.
    In this case, the browser generates an error:
    "inplview" not defined.

    I have the same problem. I think the problem is related to the Publish feature.
    Any ideas?

  • Noteboard webpart in community site with publishing feature enabled

    Hi All
    Noteboard webpart works fine as long as publishing site/web feature is not enabled
    but after it is enabled people with contribute permissions can not see the noteboard comments of the people with Moderate/Full control/Site collection access and vice versa.
    Is this the bug or there is the solution for this ? whts that?
    SP Page: http://www.facebook.com/SharePointQ SP Blog: http://swatipoint.blogspot.com

    Hi,
    Please try to disable the publishing feature to check whether it working or not. Or try to restart Distributed Cache service.
    If you do not activate the publishing infrastructure feature, the note board will appear to work, but will not store comments correctly.  The note board does not use the correct url for the page, so the notes stored using the web part, will differ from
    the notes stored using the Tags and Notes button. 
    https://donalconlon.wordpress.com/2011/03/02/adding-the-social-note-board-to-a-sharepoint-blog/
    I suggest you activate the publishing infrastructure site collection feature, then add a new Noteboard web part in a page, then check whether the issue still exsits or not.
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Which user data or customization is associated with Sharepoint Server Publishing feature

    Hi
    I want to deactivate/activate sharepoint server publishing feature but there's a warning message which says:
    Any user data or customizations associated with this feature might be lost
    How could I know specifically which user data will be lost after deactivating this feature?
    Please note that this is "Sharepoint Server Publishing" and not "Sharepoint Server Publishing Infrastructure".  The feature I want to deactivate is a site level feature and not a site collection level feature.
    Any clues may be helpfull

    If you deactivate the Publishing Infrastructure at the site collection then any items in your Pages lists may not survive.
    http://sharepoint.stackexchange.com/questions/87031/what-user-data-or-customizations-will-i-lose-if-i-deactivate-and-reactivate-a-si
    Generally speaking you need to check dependencies of other Features to this Feature, but also to ensure that existing functionality do not depend on any artifacts this feature could deploy (Web parts, physical files, controls, etc.).
    To check if other features depend on this one you could do this by looking up the GUID of the feature in a physical folder and everywhere it appears check the FeatureDependencies element.
    To identify what this feature does you would look into the Feature.xml and Elements.xml to see what artifacts it deploys, e.g. stuff deployed via Modules must be removed manually, any custom controls, web-parts, which might depend on the actual assembly
    deployed by the feature will also crash.
    Also, to my knowledge the SSRS site collection feature is part of the actual Enterprise features which are usually pushed-down from Central Admin when using the "Activate/Deactivate Enterprise Features on existing sites" - any farm admin would be able to
    re-activate it again.
    If this helped you resolve your issue, please mark it Answered

  • Web publishing tool not working

    Hello guys,
    I am trying to do web publishing of my VI. The problem that I am facing is that it is working on one system but not on my other computer. Both the computers have evaluation version of LabVIEW and the operating system is Windows XP.
    Here are the other details that I have -
    1. The Web server is enabled by going to Tools >> Options >> Web Server
    2. Port 80 is not blocked on both the computers.
    3. Firewall is disabled on both the computers. Even the antivirus is disabled.
    The error message that I am getting has been put in the attachment. The error text is " You must start the LabVIEW web server before previewing in your web page. Would you like to start now? " After this when I click yes, it is still not publishing.
    Could anyone please let me know what might be the issue? I am unable to figure out why it is working in one and not on the other. For my application, I need to use both the computers.
    Yours sincerely,
    Herok
    Attachments:
    Error.png ‏7 KB

    Hello,
    Further to my query above, I have one more observation. It gives the message saying " Downloading Panel 0.00% of o bytes"  but it never downloads anything.
    Could someone please help me out with this, my applicaiton is struck because of this.
    Yours,
    Herok
    Attachments:
    error2.png ‏12 KB

Maybe you are looking for

  • Line with endpoints following tracked points

    I have a video with two points that have been motion tracked. I want to create a line connecting these two points, with the endpoints of the line moving to match the tracked points as they move. Is there an easy way to do this?

  • Why does Sync Now no longer work on my iPad

    After several Partial backups/syncs, my iPad "Sync Now" is greed out even when I'm connected to power and the wifi network (my  macMini says I'm connected). Both machines acknowledge connection to the wifi network.

  • Streaming audio receiver

    Hi folks. I need to write a java application that receives streaming audio over the network. The audio source may vary, but will likely be an internet radio station. I assume there are many different protocols used to broadcast audio over the interne

  • Upgrade path and docs from 10.2.0.1 to 10.2.0.4?

    Can someone point me what's the upgrade path from 10.2.0.1 to 10.2.0.4 and related docs? I did search in my metalink for upgrade patch from 10.2.0.1 above ... but it doesn't show anything for my Oracle version and platform (Linux x86). Where should I

  • Question on Mean Time To Recovery Advisor.

    Howdy all. Im reading up on the MTTR Advisor and I don't really understand the point. From what Im reading http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/mgmt_db.htm , this is the desired length of time I want to wait when recove