1

These questions seem to be sprinkled across this forum but I still cannot find the answer. We are upgrading a SP2010 site to 2016. There must be some magic combination that makes this work but so far I have not found it. When we open the application in VS 2015 the tool prompts for and then completes an upgrade process. But the result is the file not found exception. If I check on the hard drive I can find the files in the expected place

"C:\Program Files\Common Files\microsoft shared\Web Server
Extensions\16\TEMPLATE\CONTROLTEMPLATES\AdminWebParts/Admin_Welcome/Admin_WelcomeUserControl.ascx"

the package.package version number is updated to 16.0 and the ascx path is

@"~/_CONTROLTEMPLATES/Brookfieldrps.OE.AdminWebParts/Admin_Welcome/Admin_WelcomeUserControl.ascx";

when the code tries to load the file from the AscxPath it cant find the file. Some posts have suggested adding 15 to the path, although 16 seems like a better choice given we are trying to go to SP2016 but neither of these work.

If I create a new web part then the Package.package version number is 16.0 and the _ascxpath is

_ascxPath = @"~/CONTROLTEMPLATES/SharePointProject1/VisualWebPart1/VisualWebPart1UserControl.ascx. 

The path where I can find the deployed code is

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\TEMPLATE\CONTROLTEMPLATES\SharePointProject1\VisualWebPart1
\VisualWebPart1UserControl.ascx

This matches what the upgraded project is. So does anyone know what the paths should be and why it can't find it at the place it is supposed to be?

Also do I have to change the "layouts" path as well?

2
  • This might be your easy way out. Create a new webpart with the same name and copy the file data into it. Commented Sep 2, 2016 at 21:54
  • I don't want to do that this is a big SharePoint application with about 10 projects and an un-countable number or controls and webparts. Thanks for the suggestion if something better does not come up I guess I will have to try it :-)
    – Noel
    Commented Sep 2, 2016 at 21:59

1 Answer 1

1

For SharePoint 2013 "~/CONTROLTEMPLATES/15/... would be correct. Apparently SharePoint 2016 also uses the 15 in layouts and controltemplates. See this post.

So "~/CONTROLTEMPLATES/15/... is your path...

1
  • to be clear need to set ~/CONTROLTEMPLATES/15/... _layouts/15 the package.package version number to 16.0 and when looking on the disc the components will be installed into the folder C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\TEMPLATE\CONTROLTEMPLATES\SharePointProject1\VisualWebPart1
    – Noel
    Commented Sep 7, 2016 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.