User Control in SharePoint 2016 Solution Deploy to 16 hive but having reference of 15 hive

Copper Contributor

Hello Floks,

 

I have installed SP2016 On Premise Enterprise Edition. I have created one User Control inside the Control Templates mapped folder of 16 hive. When the User Control is created by Visual Studio 2017, I noticed that it's having a SharePoint assembly reference of Version 15.0.0.0 which is used for SharePoint 2013. Below is SharePoint assembly in my User Control.

 

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

 After adding some custom html inside the user control, I have added application page and inside that added reference of my user control. It will generated something like below:

 

<%@ Register TagPrefix="CustomControl" TagName="ViewDetails" src="~/_controltemplates/16/CustomControl/ViewUserDetails.ascx" %>

 Notice here, it is automatically take the reference of the 16 hive folder while adding reference of User Control from Visual Studio IDE.

 

Once I added user control to application page, I have deployed the solution and verfied that all the files are deployed correctly at 16 hive folder.

 

After that when I tried to access my custom page from browser it showing an error as below:

The file '/_controltemplates/16/CustomControl/ViewUserDetails.ascx' does not exist.

Then I have updated reference of the user control from 16 hive to 15 hive and after that page is working fine as expected. Unable to find the root cause of the issue as I have created new SharePoint 2016 solution then why it's taking reference of the 15 hive folder.

 

Looking further to hear from your guys. Thank you very much for reading this. !!

2 Replies