.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

How to debug feature activation by PowerShell

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :SharePoint
 
Hello, I got a bunch of wsp files with double the number features from my visual studio 2010 solution. So now I'm using PowerShell to add and install the wsp files to my server and to activate the features for the target site. In Visual Studio 2010 rightlicking and hitting "deploy" works perfectly fine while the PowerShellscript fails with a NullReferenceException. Is there a way to locate the error? I've tried to debug the PowerShell process but when VS2010 opens up to debug the process I get an empty window without any code. I'm using a Windows Server 2008 R2, SharePoint 2010 RTM and Visual Studio 2010 RTM.


View Complete Post


More Related Resource Links

Automating Site Creation and Feature Activation with PowerShell

  

I am trying to create a blank site and then loop through the available features for that site and activate them. The problem I am facing is the list of features scoped to "web" that are returned in powershell are not the same list of web features that are visible through the site settings in the SharePoint UI or through the SharePoint 2010 Manager UI.

What I get returned from Powershell is:

DisplayName Id

----------- --

WebPageLibrary 00bfea71-c796-4402-9f2f-0eb9a6e71b18

IssuesList 00bfea71-5932-4f9c-ad71-1557e5751100

WorkflowHistoryList 00bfea71-4ea5-48d4-a4ad-305cf7030140

NoCodeWorkflowLibrary 00bfea71-f600-43f6-a895-40c0de7b0117

SurveysList 00bfea71-eb8a-40b1-80c7-506be7590102

GridList 00bfea71-3a1d-41d3-a0ee-651d11570120

GanttTasksList 00bfea71-513d-4ca0-96c2-6a47775c0119

LinksList 00bfea71-2062-426c-90bf-714c59600103

MobilityRedirect f41cc668-37e5-4743-b4a8-74d1db3fd8a4

workflowProcessList 00bfea71-2d77-4a75-9fca-76516689e21a

TasksList 00bfea71-a83e-497e-9ba0-7a5c597d0107

TeamCollab 00bfea71-4ea5-48d4-a4ad-7ea5c011abe5

AnnouncementsList 00bfea71-d1ce-42de-9c63-a44004ce0104

ObaSimpleSolution d250636f-0a26-4019-8425-a5232d592c01

PictureLibrary 00bfea71-52d4-45b3-b544-b1c71b620109

ContactsList 00bfea71-7e6d-4186-9ba8-c047ac750105

Feature activation isssue

  
Hi , I have installed the feature by STSADM command installfeature, then i goes to the site action ->site setting-> site feature i can not able to see the installed feature, so i activated it by stsadm command Activatefeature still i could not able to see the activated feature Can any one help me out to resolve this issue Regards, Pankaj Pawar    

Error on activation of feature

  
hello everybody i am creating list templates using features . i have created 3 files :- feature.xml , timesheet.xml,schema.xml . the feature is installed succesfully through stsadm but on activating feature error comes in stsadm as "Cannot complete this action.Please try again." I then tried to do it through GUI ->Sitefeatures->activate but error comes . then i tried to use force coomand as following :- stsadm -o activatefeature -name LitwareTimesheets -url "http://a-uhc:100/sites/projectmanagement" -force command prompt shows that operation completed successfully but nothing happens as i can't see feature in site features or list created in my main site . i havepasted files below:- feature.xml <?   xml version="1.0" encoding="utf-8" ?> <   Feature Id="85B2D079-AC3E-4260-9124-DBCAC2ABEAB0"     Title="Litware Timesheets"     Description="This feature provides support for Litware Timesheets"     Version="1.0.0.0"     Hidden="FALSE"     Scope="Site"     DefaultResourceFile="core"     xmlns="http://schemas.microsoft.com/sharepoint/"> <   ElementManifests> <   ElementManifest Location="Timesheets.xml"

accessing site name through feature activation.

  

HI,

I am currently using the site url to get the site to create Features. Below is the sample code:

[CODE]

  string strUrl = http://localhost:8099/sitename;

    using (SPSite site = new SPSite(strUrl))

    {

        using (SPWeb web = site.OpenWeb())

        {

}

}

[/CODE]

I would like to generalize the function. Currently, i am passing the server url and site name in the code as string variable. So when i activate the feature, the feature is activated for the site alone.

Is it possible to make the site as a generalised one. while activating feature through stsadm command, the site name is provided. Can the site name be taken from here for the code. That is in the site, i want to pass only the server url as site. when doing the activation, either way the site name will

TimerJob feature activation error: access denied

  

Hi,

I created a timer job in VS 2010 using a Class Library Project Template and performed the rest of the required steps to deploy it. It is visible in my Site Collection Features but the problem is that when I try to activate it, an error is thrown. The error in log file says

The SPPersistedObject, MyTimerJob Name=Test Timer Job, could not be updated because the current user is not a Farm Administrator.	47f5015b-f5ba-43c6-8bc6-5a8208dbe403
Feature receiver assembly 'MyTimerJob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc9139360518fedf', class 'MyTimerJob.TaskJobInstaller', method 'FeatureActivated' for feature '6805d4ac-8158-4555-8659-4a8815d0e0e1' threw an exception: System.Security.SecurityException: Access denied.   at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()   at Microsoft.SharePoint.Administration.SPJobDefinition.Update()   at MyTimerJob.TaskJobInstaller.FeatureActivated(SPFeatureReceiverProperties properties)   at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) The Zone of the assembly that failed was: MyComputer	47f5015b-f5ba-43c6-8bc6-5a8208dbe403
Feature Activation: Threw an exception, attempting to roll back. Feature 'MyTimerJob' (ID: '6805d4ac-8158-4555-8659-4a8815d0e0e1'). Exception: System.Security.SecurityException: Access denied.   at Microsoft.SharePoint.Admi

TimerJob feature activation error: access denied

  

Hi,

I created a timer job in VS 2010 using a Class Library Project Template and performed the rest of the required steps to deploy it. It is visible in my Site Collection Features but the problem is that when I try to activate it, an error is thrown. The error in log file says

The SPPersistedObject, MyTimerJob Name=Test Timer Job, could not be updated because the current user is not a Farm Administrator.	47f5015b-f5ba-43c6-8bc6-5a8208dbe403
Feature receiver assembly 'MyTimerJob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc9139360518fedf', class 'MyTimerJob.TaskJobInstaller', method 'FeatureActivated' for feature '6805d4ac-8158-4555-8659-4a8815d0e0e1' threw an exception: System.Security.SecurityException: Access denied.   at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()   at Microsoft.SharePoint.Administration.SPJobDefinition.Update()   at MyTimerJob.TaskJobInstaller.FeatureActivated(SPFeatureReceiverProperties properties)   at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) The Zone of the assembly that failed was: MyComputer	47f5015b-f5ba-43c6-8bc6-5a8208dbe403
Feature Activation: Threw an exception, attempting to roll back. Feature 'MyTimerJob' (ID: '6805d4ac-8158-4555-8659-4a8815d0e0e1'). Exception: System.Security.SecurityException: Access denied.   at Microsoft.SharePoint.Admi

Feature Install/Activation not creating List Instance

  

I have created a feature that includes a form template, two list templates (one for a doc library that uses the form and another for a custom task list template), and two list instances.  The idea is that I want installation/activation of the feature to create and register the form template, to set up the two list templates, and then to create an instance of each list template (i.e. a Doc Library and a Task List based on my templates).

The feature installs fine, and all templates are created.  However, no instances are created.  Best I can tell I have the required XML files set up as required.  There are no errors that I've been able to isolate in the SharePoint logs.

Anyone have any ideas why I might not be getting the list instances?  Below are my XMLs...

FEATURE.XML:

<?xml version="1.0" encoding="utf-8" 

Create site template wsp + Feature Activation: Cannot create folder

  

Hi,

I try to create a new site based with a site template previously saved in a wsp solution and I get the following error :

Feature Activation: Threw an exception, attempting to roll back. Feature 'OnBoarding29Modules' (ID: '8f57f818-8940-4c42-bc0d-2626c72a4553'). Exception: Microsoft.SharePoint.SPException: Cannot create folder "Workflows/OnBoardingNew/Lists/Discussion5/Attachments". ---> System.Runtime.InteropServices.COMException (0x81070203): <nativehr>0x81070203</nativehr><nativestack></nativestack>Cannot create folder "Workflows/OnBoardingNew/Lists/Discussion5/Attachments".  
 at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)  
 at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)   -
 -- End of inner exception stack trace ---  
 at Microsoft.SharePoint.Administrati

Custom Workflow deployed:Feature activation error:The file or folder name contains characters that a

  

Hi,

I am migrating custom workflow which was running in moss 2007 to SharePoint 2010.The approach was i created a new Sequential workflow project in VS 2010 under sharepoint . then i copied my Workflow files.Removed old refernces to 12 hive and updated to 14 root.

I could successfully buid this project.Then i have added Module project item called 'Forms' where i placed my Intiation form which is a infopath published form to nework location.

I could package and deploy the solution.But facing an error while Activating the feature.the error is The file or folder name contains characters that are not permitted.  Please use a different name.

 

Any help will be highly appritiated

 

Regards

Ram kiran

 


Feature Activation error:The file or folder name contains characters that are not permitted. Please

  

Hi,

I am migrating custom workflow which was running in moss 2007 to SharePoint 2010.The approach was i created a new Sequential workflow project in VS 2010 under sharepoint . then i copied my Workflow files.Removed old refernces to 12 hive and updated to 14 root.

I could successfully buid this project.Then i have added Module project item called 'Forms' where i placed my Intiation form which is a infopath published form to nework location.

I could package and deploy the solution.But facing an error while Activating the feature.

 

Any help will be highly appritiated

 

Regards

Ram kiran


Help - uanble to Debug Feature Receiver with VS2010 on SP2010 Farm

  

HI,

I am unable to debug the feature receiver using VS2010. I Changed the Active Deployment Configuration from Default to No Activation. Set the breakpoint and press F5, I get the below error

 "Unable to start debugging on the web server. The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. "

 We are running VS2010 on x64 bit Windows2008 server and the farm has 1 App server, 1 WFE server and 1 sql server.

I would really appreciate any help regarding this.

Thanks! 

 


Disable Feature Across Site Collections using Powershell

  

Hello all,

I am trying to disable a feature across multiple site collections. Is there anyway to scope this so it hits all site collections in a Web Application? I am currently using the following:

Disable-SPFeature –identity "MyFeature" -URL https://mywebapp



Using SharePoint Search feature in ASP.Net Application

  
Integrating ASP.Net application in to MOSS 2007 to utilize SharePoint Enterprise Search Feature can be done by using Business Data Search.

Activation error occured while trying to get instance of type Database, key "DBName"

  

Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<connectionStrings>
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"
providerName="System.Data.SqlClient

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />
</connectionStrings>


Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)


Database myDB=EnterpriseLibraryCo

Debug implementation of URLrewriter.net

  

Hi,

After some googling and help from the forum, I have integrated the the URLrewrting.net in my project. There are no error when I build the project, but the URL rewriting does not work. I am able to figure ot where the problem is. Is there a way to debug this. The code is as below:

 Web.config file

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
	<configSections>
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.W

May i use the collapse and expand feature (like tree menu) in Report ?

  

HI all,

May i use the collapse and expand feature (like tree menu) at Report iam using the Report viewer  Control for displaying the Report on my Asp.net Page .

 

I have number records and each record have detail as i clicked or expand the record then details will be shown is it possible with report viewer control 
 
If any one have experince before please share the ideas.

 

Best Regards


C++ Plus: Beef Up Windows Apps with the Visual C++ 2008 Feature Pack

  

Kenny Kerr sings the praises of the new Visual C++ 2008 Feature Pack, which brings modern conveniences to Visual C++.

Kenny Kerr

MSDN Magazine May 2008


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend