Not seeing the List show up

Editor
May 15, 2012 at 3:55 PM

I uploaded the wsp to the Solutions gallery and activated it

I don't see the List show up

nor an error

I looked at the source, and couldn't find a feature event receiver

 

How are you creating the list ? and how do I debug it not showing up ?

If it doesn't create until the first sucessful log call - then I probably need more help with packaging the client dll with my sandboxed solution so it will deploy properly.

I didn't see anything about packaging codeplex.spsl.dll for use by sandboxed solutions

Coordinator
May 15, 2012 at 5:00 PM

Hi Mark,

The list will be created the first time you log something to it, if the feature is activated.

Sounds to me like you installed it and activate it.

Now, all you need to do is reference the logger DLL in your solution, create an instance of the logging class and log some warning/info or error message.

To make sure we are on the same page, you need to copy the logger DLL into your sandbox package, reference and use it - that's in addition to deploying the logger package. The reason is, that if the DLL is not in your sandbox package - you cannot access it.

Let me know if you need more help with this,

Shai.

Coordinator
May 15, 2012 at 5:00 PM

Also - Please post back if you got it to work, so other people would benefit and so that I could update the documentation accordingly.

Cheers :)

Editor
May 15, 2012 at 5:16 PM

Thanks for answering quickly, I was afraid codeplex might not be so active

In my sandboxed package

Advanced packaging

It claims to be making a safe control entry in the ULS logs

Solution Deployment : Added safe control entry <SafeControl Assembly="codeplex.spsl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a7faf2242cf7836" Namespace="codeplex.spsl" TypeName="*" Safe="True" SafeAgainstScript="False" />

using codeplex.spsl;

Logging logger;

public override void FeatureActivated(SPFeatureReceiverProperties properties) {

logger = new Logging(this.GetType());

if (logger.IsLoggingEnabled)

{

logger.LogInfo("FeatureActivated started");

}

?????

What I am REALLY trying to do, is just check in the files in Style Library

I am getting Access Denied, so I was trying to log what was successful and not

But getting the logging working is as challenging as the sandboxed web part in the first place

Just to be clear – your wsp goes in the solution gallery ? right

P.S. I don’t need to check IsLoggingEnabled ? do I ?

The .Loginfo and .LogError will keep the items in the collection if Logging is not enabled ?

Thanks

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

Description: Envision it Logo small Mark A. Jones - Lead Architect
905.812.3009 x229 www.envisionIT.com mjones@envisionit.com

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

From: shaipetel [email removed]
Sent: Tuesday May, 15 2012 1:01 pm
To: Mark Jones
Subject: Re: Not seeing the List show up [spsl:355858]

From: shaipetel

Also - Please post back if you got it to work, so other people would benefit and so that I could update the documentation accordingly.

Cheers :)

Coordinator
May 15, 2012 at 5:26 PM

Actually, Mark, I was confused for a minute there.

The full trust version creates the log list on the fly.

This is not possible in sandbox, so in the sandbox version (this one) activating the feature supposed to create the logging list!

http://spsl.codeplex.com/SourceControl/changeset/view/89625#1778587

Meaning, once you activate the logging feature it should create a list with permissions to everyone to write to (so everyone can log into it).

If you activated the feature and don't see the list - this is the problem...

The feature is called "SharePoint Sandbox Logging". Can you double check if you installed and activated this feature?

The list URL should be "Lists/SharePoint Sandbox Log", just in case you cant see it in the navigation - try to browse to it directly.

Coordinator
May 15, 2012 at 5:27 PM

P.S the log list should be created only at the root web in your site collection, so look for it there.

It might be hidden, I don't remember - if it is you should be able to get to it using the URL.

Editor
May 15, 2012 at 6:01 PM
Edited May 15, 2012 at 8:49 PM

Ok – I have been Confused about where “Features” show up for sand boxed solutions

 

e.g. nothing shows up here

/_layouts/ManageFeatures.aspx

 

 

View all site content at the top level /_layouts/viewlsts.aspx does not show your list

 

Trying your Url – doesn’t find it either – it is not there

Lists/SharePoint Sandbox Log 

 

 

So if I look for your template in the List template gallery I am not seeing it either

_catalogs/lt/Forms/AllItems.aspx

 

 

 

I’ll deactive and reactivate your solution in the solution gallery

_catalogs/solutions/Forms/AllItems.aspx

No errors reported there

 

ULS logs say:

 

Entering monitored scope (Feature Installation: Installing Feature 'SharePoint Sandbox Logging_SharePoint Sandbox Logging' (ID: '1e9e8401-cda9-4f22-9def-5df3784177a4') into the farm.) 8046627b-d934-4029-9528-6b308f0ca510

 

Leaving Monitored Scope (Feature Installation: Installing Feature 'SharePoint Sandbox Logging_SharePoint Sandbox Logging' (ID: '1e9e8401-cda9-4f22-9def-5df3784177a4') into the farm.). Execution Time=0.0586666741164031 8046627b-d934-4029-9528-6b308f0ca510

 

No errors !! but not much news either

 

Still no List at the root

 

 

I am a site collection administrator - double checked that

 

???

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

  

 

From: shaipetel [email removed]
Sent: Tuesday May, 15 2012 1:27 pm
To: Mark Jones
Subject: Re: Not seeing the List show up [spsl:355858]

 

From: shaipetel

Actually, Mark, I was confused for a minute there.

The full trust version creates the log list on the fly.

This is not possible in sandbox, so in the sandbox version (this one) activating the feature supposed to create the logging list!

http://spsl.codeplex.com/SourceControl/changeset/view/89625#1778587

Meaning, once you activate the logging feature it should create a list with permissions to everyone to write to (so everyone can log into it).

If you activated the feature and don't see the list - this is the problem...

The feature is called "SharePoint Sandbox Logging". Can you double check if you installed and activated this feature?

The list URL should be "Lists/SharePoint Sandbox Log", just in case you cant see it in the navigation - try to browse to it directly.

Editor
May 15, 2012 at 7:18 PM
Edited May 15, 2012 at 8:49 PM

> The .Loginfo and .LogError will keep the items in the collection if Logging is not enabled ?

 

I was just looking in the dll with Telerik justDecompile

 

If logging is not enabled, then all the methods just return immediately

The unreportedErrors list will only get populated if logging is enabled, but writing to the list causes an exception

 

 

 

So I think if loging is not enabled it should just fail silently – which I guess is what it is doing L 

 

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

 

From: Mark Jones
Sent: Tuesday May, 15 2012 1:16 pm
To: 'spsl@discussions.codeplex.com'
Subject: RE: Not seeing the List show up [spsl:355858]

 

Thanks for answering quickly, I was afraid codeplex might not be so active

 

 

In my sandboxed package

 

 

 

Advanced packaging

 

 

 

It claims to be making a safe control entry in the ULS logs

 

Solution Deployment : Added safe control entry <SafeControl Assembly="codeplex.spsl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a7faf2242cf7836" Namespace="codeplex.spsl" TypeName="*" Safe="True" SafeAgainstScript="False" />

 

 

using codeplex.spsl;

 

Logging logger;

 

public override void FeatureActivated(SPFeatureReceiverProperties properties) {

 

 

logger = new Logging(this.GetType());

if (logger.IsLoggingEnabled)

{

logger.LogInfo("FeatureActivated started");

}

 

 

 

?????

 

What I am REALLY trying to do, is just check in the files in Style Library

I am getting Access Denied, so I was trying to log what was successful and not

But getting the logging working is as challenging as the sandboxed web part in the first place

 

 

 

Just to be clear – your wsp goes in the solution gallery ? right
 

 

 

 

P.S. I don’t need to check IsLoggingEnabled ? do I ?

The .Loginfo and .LogError will keep the items in the collection if Logging is not enabled ?

 

 

Thanks

 

 

 

 

From: shaipetel [email removed]
Sent: Tuesday May, 15 2012 1:01 pm
To: Mark Jones
Subject: Re: Not seeing the List show up [spsl:355858]

 

From: shaipetel

Also - Please post back if you got it to work, so other people would benefit and so that I could update the documentation accordingly.

Cheers :)

Editor
May 15, 2012 at 9:39 PM

ULS log – I noticed this after trying again to deactivate/ activate - is this the list failing to install ?

Missing one or more of the following attributes from the root node in solution SharePoint Sandbox Logging v1.1.00.wsp: assembly '', type ''.

Solution Deployment : EnableSiteCollectionSolution. Force : 'False'

Updating SPPersistedObject SPFeatureDefinition Name=FeatureDefinition/1e9e8401-cda9-4f22-9def-5df3784177a4. Version: -1 Ensure: False, HashCode: 9385506, Id: 1e9e8401-cda9-4f22-9def-5df3784177a4,

Stack: at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()

at Microsoft.SharePoint.Administration.SPPersistedChildCollection`1.Add(T newObj, Boolean ensure)

at Microsoft.SharePoint.Administration.SPPersistedChildCollection`1.Add(T newObj)

at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.AddCore(SPFeatureDefinition featdef, SPSite site, String solutionHash, Boolean fForce, Boolean fDoValidation)

at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.AddInternal(String relativePathToFeatureManifest, Guid solutionId, String solutionHash, SPSite site, Boolean force, Boolean fDoValidation, SPFeatureDefinitionContext featureDefinitionContext)

at Microsoft.SharePoint.Administration.SPSolutionPackage.AddFeatureDefinitions(SPFeatureDefinitionCollection featColl, SPFeatureDefinitionContext context, Boolean force, Boolean activateFeatures, SPSite site, SPWeb web)

at Microsoft.SharePoint.Administration.SPUserCodeSolutionPackage.EnableSiteCollectionSolution(SPSite site, Int32 solutionGalleryItemId, Boolean force)

at Microsoft.SharePoint.SPUserSolutionCollection.<>c__DisplayClass1.<AddOrUpgrade>b__0() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)

at Microsoft.SharePoint.SPUserSolutionCollection.AddOrUpgrade(SPListItem item, SPUserSolution existingSolution)

at Microsoft.SharePoint.SPUserSolutionCollection.Add(Int32 solutionGalleryItemId)

at Microsoft.SharePoint.WebControls.SolutionItemButton.ActivateItem()

at Microsoft.SharePoint.WebControls.SPLinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)

at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context)

at ASP.ACTIVATE_ASPX__420317546.ProcessRequest(HttpContext context)

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)

at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)

at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)

at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

????

From: shaipetel [email removed]
Sent: Tuesday May, 15 2012 1:28 pm
To: Mark Jones
Subject: Re: Not seeing the List show up [spsl:355858]

From: shaipetel

P.S the log list should be created only at the root web in your site collection, so look for it there.

It might be hidden, I don't remember - if it is you should be able to get to it using the URL.

Editor
May 16, 2012 at 6:56 PM

I tried a different VM today

Activating the SPSL still did not create a list,

But I also see no errors in the ULS log

My Sandbox solution is not failing while trying to log – but I also see no logging

My next step may be to try and manually create the List – I see the template is deliberately hidden, so I can’t use it to create the list

But my focus has been to get my sandbox solution working – I find it is now activating correctly on the new vm, but not uninstalling – logging would really help

So part of my initial issues seem to be specific to the one server – which I thought was behaving

- Mark Jones

Coordinator
May 17, 2012 at 4:59 PM

Hi Mark, I'm back.

I will install this package again and double check it for you.

Once installed and deployed, you should have a site collection level feature. if you don't have one - logging will not work.

Give me a minute to double check and post back here.

Coordinator
May 17, 2012 at 5:08 PM

Hi Mark,

I just checked and it is working perfectly for me.

Let me go over the steps with you:

  1. Download the sandbox logging wsp file from codeplex into your desktop
  2. Go to site collection settings, gallery, solutions gallery
  3. Upload the wsp package into the gallery
  4. Activate the solution in the gallery
  5. Go to site collection settings -> site collection features (not site features!)
  6. You should have a new feature called "SharePoint Sandbox Logging". Activate it.
  7. Once activated, go to site actions menu -> view all site content
  8. You should have a new list created called "SharePoint Sandbox Log"

Please follow these steps and let me know where you are experiencing trouble.

Please note: you should deploy this as a sandbox package, by uploading to the solution gallery. For that to work - your sandbox user code service must be enabled and running in your central administration.

Thanks!


Editor
May 17, 2012 at 6:45 PM

Sorry

/_layouts/ManageFeatures.aspx?Scope=Site

/_layouts/ManageFeatures.aspx?Scope=Web

Are the two lists – the first one from Site Actions | Site settings | Site collection Administration | Site collection Features

I don’t see my sandboxed feature there either, only “normal” Enable-SpFeature features

I assumed sandboxed features were hidden ???

But you are saying this server is also broken, and not showing sadboxed features ?

e.g.

SharePoint 2007 Workflows

Aggregated set of out-of-box workflow features provided by SharePoint 2007.

SharePoint Server Enterprise Site Collection features

Features such as InfoPath Forms Services, Visio Services, Access Services, and Excel Services Application, included in the SharePoint Server Enterprise License.

SharePoint Server Publishing Infrastructure

Provides centralized libraries, content types, master pages and page layouts and enables page scheduling and other publishing functionality for a site collection.

Active

SharePoint Server Standard Site Collection features

Features such as user profiles and search, included in the SharePoint Server Standard License.

From: shaipetel [email removed]
Sent: Thursday May, 17 2012 1:09 pm
To: Mark Jones
Subject: Re: Not seeing the List show up [spsl:355858]

From: shaipetel

Hi Mark,

I just checked and it is working perfectly for me.

Let me go over the steps with you:

1. Download the sandbox logging wsp file from codeplex into your desktop

2. Go to site collection settings, gallery, solutions gallery

3. Upload the wsp package into the gallery

4. Activate the solution in the gallery

5. Go to site collection settings -> site collection features (not site features!)

6. You should have a new feature called "SharePoint Sandbox Logging". Activate it.

7. Once activated, go to site actions menu -> view all site content

8. You should have a new list created called "SharePoint Sandbox Log"

Please follow these steps and let me know where you are experiencing trouble.

Please note: you should deploy this as a sandbox package, by uploading to the solution gallery. For that to work - your sandbox user code service must be enabled and running in your central administration.

Thanks!



Editor
May 17, 2012 at 7:08 PM

I just did it – one more time

And this time your feature is there _layouts/ManageFeatures.aspx?Scope=Site

I activate it

And the list is there !!!

/Lists/SharePoint%20Sandbox%20Log/AllItems.aspx

But… my solution which I was trying to log with doesn’t

So that is probably list permissions ? – it is currently inheriting from it’s parent

From: Mark Jones
Sent: Thursday May, 17 2012 2:45 pm
To: 'spsl@discussions.codeplex.com'
Subject: RE: Not seeing the List show up [spsl:355858]

Sorry

/_layouts/ManageFeatures.aspx?Scope=Site

/_layouts/ManageFeatures.aspx?Scope=Web

Are the two lists – the first one from Site Actions | Site settings | Site collection Administration | Site collection Features

I don’t see my sandboxed feature there either, only “normal” Enable-SpFeature features

I assumed sandboxed features were hidden ???

But you are saying this server is also broken, and not showing sadboxed features ?

e.g.

SharePoint 2007 Workflows

Aggregated set of out-of-box workflow features provided by SharePoint 2007.

SharePoint Server Enterprise Site Collection features

Features such as InfoPath Forms Services, Visio Services, Access Services, and Excel Services Application, included in the SharePoint Server Enterprise License.

SharePoint Server Publishing Infrastructure

Provides centralized libraries, content types, master pages and page layouts and enables page scheduling and other publishing functionality for a site collection.

Active

SharePoint Server Standard Site Collection features

Features such as user profiles and search, included in the SharePoint Server Standard License.

From: shaipetel [email removed]
Sent: Thursday May, 17 2012 1:09 pm
To: Mark Jones
Subject: Re: Not seeing the List show up [spsl:355858]

From: shaipetel

Hi Mark,

I just checked and it is working perfectly for me.

Let me go over the steps with you:

1. Download the sandbox logging wsp file from codeplex into your desktop

2. Go to site collection settings, gallery, solutions gallery

3. Upload the wsp package into the gallery

4. Activate the solution in the gallery

5. Go to site collection settings -> site collection features (not site features!)

6. You should have a new feature called "SharePoint Sandbox Logging". Activate it.

7. Once activated, go to site actions menu -> view all site content

8. You should have a new list created called "SharePoint Sandbox Log"

Please follow these steps and let me know where you are experiencing trouble.

Please note: you should deploy this as a sandbox package, by uploading to the solution gallery. For that to work - your sandbox user code service must be enabled and running in your central administration.

Thanks!



Editor
May 17, 2012 at 8:19 PM

Different Site now – same machine - your logger installed correctly

I am now in my event handler – which the debugger stopped in, when I toggled activate/deactive in the solution gallery

It creates the instance of logger

logger = new Logging(this.GetType());

but it is not enabled

But the feature is active and the list is there

Let me try the version that passes the site in – since I have already retrieved that

logger = new Logging(site,this.GetType());

Yup – now I have 32 items in the log !!

I guess in a feature event receiver you cannot rely on getting the current site from sp context, you have to get it from the properties passed in

So someone has to pass it in to you

Truthfully – if you have no site ? how are you running – lack of site should throw an exception

We are off to the races now !!!

From: Mark Jones
Sent: Thursday May, 17 2012 3:08 pm
To: 'spsl@discussions.codeplex.com'
Subject: RE: Not seeing the List show up [spsl:355858]

I just did it – one more time

And this time your feature is there _layouts/ManageFeatures.aspx?Scope=Site

I activate it

And the list is there !!!

/Lists/SharePoint%20Sandbox%20Log/AllItems.aspx

But… my solution which I was trying to log with doesn’t

So that is probably list permissions ? – it is currently inheriting from it’s parent

From: Mark Jones
Sent: Thursday May, 17 2012 2:45 pm
To: 'spsl@discussions.codeplex.com'
Subject: RE: Not seeing the List show up [spsl:355858]

Sorry

/_layouts/ManageFeatures.aspx?Scope=Site

/_layouts/ManageFeatures.aspx?Scope=Web

Are the two lists – the first one from Site Actions | Site settings | Site collection Administration | Site collection Features

I don’t see my sandboxed feature there either, only “normal” Enable-SpFeature features

I assumed sandboxed features were hidden ???

But you are saying this server is also broken, and not showing sadboxed features ?

e.g.

SharePoint 2007 Workflows

Aggregated set of out-of-box workflow features provided by SharePoint 2007.

SharePoint Server Enterprise Site Collection features

Features such as InfoPath Forms Services, Visio Services, Access Services, and Excel Services Application, included in the SharePoint Server Enterprise License.

SharePoint Server Publishing Infrastructure

Provides centralized libraries, content types, master pages and page layouts and enables page scheduling and other publishing functionality for a site collection.

Active

SharePoint Server Standard Site Collection features

Features such as user profiles and search, included in the SharePoint Server Standard License.

From: shaipetel [email removed]
Sent: Thursday May, 17 2012 1:09 pm
To: Mark Jones
Subject: Re: Not seeing the List show up [spsl:355858]

From: shaipetel

Hi Mark,

I just checked and it is working perfectly for me.

Let me go over the steps with you:

1. Download the sandbox logging wsp file from codeplex into your desktop

2. Go to site collection settings, gallery, solutions gallery

3. Upload the wsp package into the gallery

4. Activate the solution in the gallery

5. Go to site collection settings -> site collection features (not site features!)

6. You should have a new feature called "SharePoint Sandbox Logging". Activate it.

7. Once activated, go to site actions menu -> view all site content

8. You should have a new list created called "SharePoint Sandbox Log"

Please follow these steps and let me know where you are experiencing trouble.

Please note: you should deploy this as a sandbox package, by uploading to the solution gallery. For that to work - your sandbox user code service must be enabled and running in your central administration.

Thanks!



Coordinator
May 18, 2012 at 5:43 PM

Hi Mark!

so happy you finally see it. Sandbox features are not automatically hidden - if you didn't see it, my guess is something was wrong, perhaps the user code service wasn't running correctly.

Now that you see it, it should work.

Since you are using it in an event handler - please remember you don't have context objects, so make sure you create the SPSite object yourself and pass it to the constructor.

The SPSite object must be the same site where you installed and activated the logger! Please double check it is indeed that site and not wrong one.

The list should be created with special permissions allowing everyone to write to it.

But, just in case, you can try to create an elevated SPSite object and pass it to the logger - this will make sure it has enough permissions.

I don't think it is needed, but you can try.

My guess is, that the SPSite object you are passing is the wrong site, or you maybe disposing of it before logger finished working with it?

Let me know. Good luck!!!

P.S - does your sandbox code running? try building and testing a simple hello world sandbox web part.

P.P.S - Please don't quote the thread in your replies… its getting too long and hard to read.

Thanks.

 

Editor
May 18, 2012 at 6:11 PM

I passed the same Site I had in the event receiver

No one said the context would not get picked up inside the library – that would be some good docs to add
( I am still thinking if the spcontext is null, and site is not specified, you should throw an exception, rather than silently treating it as logging not enabled)

As well as the Exact steps to activate the feature properly. – which I guess are now in this thread for the next person

Now that the logging is working can I call the logging from OUTSIDE the sandbox ? probably not because the sandbox is running in a different process ?

I would need the non sandbox version ? that is not on Codeplex ?

Just wondering – for now everything is working the way I wanted to

Now I need to debug the sandboxed web part that I was handed to package

Thanks again !

Coordinator
May 18, 2012 at 6:16 PM

Hi,

So glad it is working!

You can add a reference to the API DLL from any solution, sandboxed or full trust. it should work from anywhere. You don't need a different version.

The API dll (one you add reference to) is the one doing all the logging work.

The sandbox logging package is mainly for 2 things:

1. creating the list

2. enabling / disabling the logging

 

As for documentation, how about I make you contributor on the project and you can add or edit the documentation pages? Sounds good?

Editor
May 18, 2012 at 7:57 PM

Ø The sandbox logging package is mainly for 2 things: 1. creating the list 2. enabling / disabling the logging

BUT the Feature can also be enabled/disabled without enabling /disabling the SB solution

- It seems to me the feature should be automatically enabled/disabled when the solution is – with an event receiver ?

Ø As for documentation, how about I make you contributor on the project and you can add or edit the documentation pages? Sounds good?

Sure – I guess I am the expert now ;-) ?