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

%3CLINGO-SUB%20id%3D%22lingo-sub-88782%22%20slang%3D%22en-US%22%3EUser%20Control%20in%20SharePoint%202016%20Solution%20Deploy%20to%2016%20hive%20but%20having%20reference%20of%2015%20hive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-88782%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Floks%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20installed%20SP2016%20On%20Premise%20Enterprise%20Edition.%20I%20have%20created%20one%20User%20Control%20inside%20the%20Control%20Templates%20mapped%20folder%20of%2016%20hive.%20When%20the%20User%20Control%20is%20created%20by%20Visual%20Studio%202017%2C%20I%20noticed%20that%20it's%20having%20a%20SharePoint%20assembly%20reference%20of%20Version%2015.0.0.0%20which%20is%20used%20for%20SharePoint%202013.%20Below%20is%20SharePoint%20assembly%20in%20my%20User%20Control.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%26lt%3B%25%40%20Register%20Tagprefix%3D%22SharePoint%22%20Namespace%3D%22Microsoft.SharePoint.WebControls%22%20Assembly%3D%22Microsoft.SharePoint%2C%20Version%3D15.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D71e9bce111e9429c%22%20%25%26gt%3B%3C%2FPRE%3E%3CP%3E%26nbsp%3BAfter%20adding%20some%20custom%20html%20inside%20the%20user%20control%2C%20I%20have%20added%20application%20page%20and%20inside%20that%20added%20reference%20of%20my%20user%20control.%20It%20will%20generated%20something%20like%20below%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%26lt%3B%25%40%20Register%20TagPrefix%3D%22CustomControl%22%20TagName%3D%22ViewDetails%22%20src%3D%22~%2F_controltemplates%2F16%2FCustomControl%2FViewUserDetails.ascx%22%20%25%26gt%3B%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3CEM%3ENotice%20here%2C%20it%20is%20automatically%20take%20the%20reference%20of%20the%2016%20hive%20folder%20while%20adding%20reference%20of%20User%20Control%20from%20Visual%20Studio%20IDE.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20I%20added%20user%20control%20to%20application%20page%2C%20I%20have%20deployed%20the%20solution%20and%20verfied%20that%20all%20the%20files%20are%20deployed%20correctly%20at%2016%20hive%20folder.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20that%20when%20I%20tried%20to%20access%20my%20custom%20page%20from%20browser%20it%20showing%20an%20error%26nbsp%3Bas%20below%3A%3C%2FP%3E%3CPRE%3EThe%20file%20'%2F_controltemplates%2F16%2FCustomControl%2FViewUserDetails.ascx'%20does%20not%20exist.%3C%2FPRE%3E%3CP%3EThen%20I%20have%20updated%20reference%20of%20the%20user%20control%20from%2016%20hive%20to%2015%20hive%20and%20after%20that%20page%20is%20working%20fine%20as%20expected.%20Unable%20to%20find%20the%20root%20cause%20of%20the%20issue%20as%20I%20have%20created%20new%20SharePoint%202016%20solution%20then%20why%20it's%20taking%20reference%20of%20the%2015%20hive%20folder.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELooking%20further%20to%20hear%20from%20your%20guys.%20Thank%20you%20very%20much%20for%20reading%20this.%20!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-88782%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E15%20hive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E16%20hive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EApplication%20Pages%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%202016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EUser%20Controls%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-750781%22%20slang%3D%22en-US%22%3ERe%3A%20User%20Control%20in%20SharePoint%202016%20Solution%20Deploy%20to%2016%20hive%20but%20having%20reference%20of%2015%20hive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-750781%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F67950%22%20target%3D%22_blank%22%3E%40Jay%20Doshi%3C%2FA%3E%26nbsp%3BDid%20you%20ever%20solve%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Visitor

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