Field or property "Audit" does not exist

Deleted
Not applicable

I am using SharePointPnPCore2013 Nuget Package to create a template xml using the method explained at the video below.

https://channel9.msdn.com/blogs/OfficeDevPnP/Getting-Started-with-PnP-Provisioning-Engine

 

However, i get an error "Field or property "Audit" does not exist" at  GetProvisioningTemplate method. Can you please suggest me a way to get rid of this error?

 

12 Replies

Hi Prasad,

 

It seems the custom column does not yet exist. But just a questoin did you first get a export of a site or did you start from scratch? and are you provisioning a subsite or a site. Do you use content types?

 

so a bit more info would be helpfull.

 

Hi Paul. Thank you for getting back to me. Answers below. 1. I get an error while exporting the site 2. It is a POC. So I have created a site collection using OOB Team site as template and trying to save the site as xml using the PnP Provisioning Engine. 3. I am trying to provision a site collection. 4. There are no additional content types added. Site has only those elements created as part of the site creation 5. I use a multi tenant environment. Does that have an impact? 6. I did try the same steps on an Office 365 site (using corresponding nuget package), it worked fine without any error. I face this issue only on SharePoint On Premise. Happy to provide any additional information.
Hi Prasad, so code is running fine on Office365? did you change the library to On premm with PNP? @Vesa Juvonen any idea?

This seems to be due the fact that some of the CSOM properties are not available in on-premises, which are available in SharePoint Online. This particular code sample is built towards SP Online, so it is using Online CSOM by default. If you do not update the PnP Core Nuget package  to matching on-premises version (2013 or 2016), you will see this kind of issues.

 

So - how to fix it? - Update the PnP Core Nuget package reference to be for on-premises. Here's a blog post, which explains the CSOM version challenge in practice and which version should be used where - https://dev.office.com/blogs/using-correct-csom-version-for-sharepoint-customizations. 

Hi Paul Thank you for your inputs. I was able to get rid of this error by installing June 2016 CU on my SharePoint on premise environment. It works fine now and TemplateXML gets created successfully. However, I get some errors while applying template xml created for a Publishing site. Is there a way to skip the errors and proceed with rest of the steps while applying template?
Thank you @Vesa Juvonen I am using the Nuget Package for SharePoint On Premise named "SharePointPnPCore2013" . I installed June 2016 CU and that seems to have helped. It is working fine now.

I are using SharePointPnPCore2013 2.11.1701.1 and I am still having issues.  Are there any other updates?

There's two factors for this.

 

  1. Right PowerShell/Nuget package - you'll need to use the specific version, like SP2013 version for SP2013
  2. Rigth SP2013 version being installed on the server side. Our baseline is April 2015 CU - If you are using older version of the SP2013 installation, you might run into issues

Thank you, Vesa.

 

I installed/applied SP2013 January 2017 CU, I passed that error.  Now, it throws null pointer error at line

 

web.ApplyProvisioningTemplate(template, ptai);

 

Any ideas?

 

Malathi.

This really comes down on the code and template what you're using. I'd do following.

 

  1. Ensure that code works - export / import oob team site without any modifications
  2. If that does not work - then there's something else environmental, like permissions
  3. If that works - issue is in the template side - so it's then matter of double checking the template content and figure out what goes wrong

Without access on the used template, we can't reproduce which means that there's no way to be 100% what goes wrong. WIth the exception, you should also get nice stack trace, which will give you and us insights on what / where issue occured.

Vesa

 

I am using the sample Provisioning.Framework.Console, I am able to export the template, but while importing I am receiving the null object error at applying the template.  I notice that the nuget packages are not correct.  What are necessary the packages for on-prem?

 

Microsoft.SharePointOnline.CSOM
Microsoft.SharePoint2013.CSOM
AppForSharePointOnlineWebToolkit
AppForSharePointWebToolkit
SharePointPnPCore2013

 

Installing SharePointPnPCore2013, installs AppForSharePointOnlineWebToolkit, and there seems to be conflict in CSOM libraries as well.  Any pointer you provide will be helpful, also how do I about getting to the stack.  I do not see much on that specific line, both objects are not null, I am assuming it is to do with the CSOM library.

 

Attached the debugger to the PnP Core, found out the null object comes from Managed Metadata Service not running. After starting the service, I have passed that error