Visual Studio not responding when creating new SharePoint Framework project

Issue:

When we install SharePoint Framework extensions to Visual Studio 2017, and try to create a SharePoint Framework project, it keeps on creating the project and goes into Not Responding mode.

Analysis:

This is related to npm package microsoft/generator-sharepoint version.

The scaffolding procedure has changed in this version and it contains now an additional option to choose which type of client-side component you would like to create (WebPart or Extension in preview). This option was not present in previous versions of microsoft/generator-sharepoint package. The generation in Visual Studio stops at this option.

Solution:

Upgrade to the version 1.0.4. Download from here.

This will help resolve the issue.

Advertisements

CRUD operations on Provider Hosted SharePoint Add-In to Azure SQL Database

Hi All,

This post is about connecting a SharePoint provider hosted add-in deployed on Azure to a Azure SQL DB for performing basic CRUD operations.

Prerequisites:

  • Microsoft Azure account.
  • Office 365 account
  • Visual Studio 2015/2017 with SharePoint extensions.
  • A empty provider hosted add-in with ACS mode created and deployed on an Azure web app.

Steps:

  • Create Azure SQL DB:
    • Within Azure portal, click New –> Databases –> SQL Database
    • Enter SQL server details.

1

2

  • Update DB server firewall to allow client IP access to the DB
    • Go to list of DBs in Azure, select the current DB – Select ‘Set server firewall’
    • Hit ‘Add client IP’ and then hit Save button.

3

4

  • Modify Provider hosted add-in to create model ¬†from newly created DB:
    • Within project, go to Project –> Models –> Right click add new item. Select ADO.NET Entity data model from Data tab.
    • Select EF Designer from Database option to choose model contents
    • Provide correct Azure connection details to establish the correct connection with newly created Azure SQL DB.
      5
  • Modify Provider hosted add-in to create controller from newly created DB:
    • Within project, go to Project –> Controllers –> Right click add controller 

      910

  • Next add link in the layouts page for user to click from the application.

11

Next when running the SharePoint App, and clicking Customers link, you should be able to see all the data on the screen as shown below:

12

SharePoint 2013 MySite page opening blank for a single user

Sharing another live project issue that I faced with one of my customers..

A single user when trying to open SharePoint 2013 Mysite page, was getting a blank page. This was happening on some other Mysite pages also.

Also user was sometimes receiving error:

System.ArgumentException: calType
at Microsoft.SharePoint.Utilities.SPIntlCal.GetLocalCalendar(SPCalendarType calType)

Solution:

  • Go to My Site Settings in Central Administration
  • Edit the user profile for the user having the issue
  • The setting for ‘Set your calendar’ would be blank
  • Set this to a value like – Gregorian
  • Save the profile
  • User would be able to access the My site pages.

SharePoint Crawl DB size increasing @20GB per day

Recently, one of my SharePoint farms faced an issue where the volume utilization of DB server (SharePoint crawl database) went upto 99% within 10 days.

Analysis:
– Looking at the crawl DB log in SharePoint, the incremental crawl was running every 1.5 hours with 0 success and 100% failures.

– There were about 961K errors with each incremental crawl scheduled at every 2 hours.

– There is a temporary folder that Crawl uses to place files temporarily on the server. The path is C:\Users\”SPAdminAccount”\AppData\Local\Temp\gthrsvc_OSearch14\

– I found out that this temporary folder was somehow missing / deleted.

Solution:

On creating the above mentioned folder manually, the success rate of crawl went high and there were very less failures (as expected)

Post this, the space utilization went about 10 MB a day which is expected during crawl.

CAML Designer 2013

For any SharePoint developer, CAML Query builder has always been a tool used very frequently for development of custom SharePoint solutions.

With SharePoint 2013 CAML Designer:

  • you can build CAML queries for single lists
  • you can build queries that can be executed with SPSiteDataQuery
  • beside the pure CAML queries, you can also get code snippets for the server-side object model, the .NET client-side object model, the JavaScript client-side object model and last but not least code snippets when working with REST.
  • Autogenerate the actual CAML Query
  • Autogenerate Server OM code
  • Autogenerate CSOM .NET code
  • Autogenerate CSOM REST code
  • Autogenerate Web Service code
  • Autogenerate PowerShell code

Map SharePoint library to Network Drive

Sometimes it becomes necessary to map a SharePoint document library as a network drive. This may be a customer requirement, or developer requirement to manage the SharePoint folder structure.

Sharing the steps below for the same:

Step 1:
Note down the document library’s site path which needs to be mapped as a network drive.

Example: https://home.intranet.com/departments/finance

Step 2:
Open File explorer, Right click, Select – Add Network Location




Step 3:
Click Next, and select option – Choose a custom network location, select Next.

Step 4:
Enter the SharePoint site URL. Click Next

Step 5:
It should prompt for credentials to connect to the SharePoint site. Enter Administrator credentials along with domain name.
It will ask for a name to be provided for this network drive location. Provide a custom name e.g. Finance Site.

Press Next.

Step 6:
It should now open the mapped drive location along with lots of folders. These folders represent all the lists and libraries contained in this SharePoint site.
You should also be able to view the Document library here.