Mar 13 2017 09:34 AM
I am using VS2017.
I have downloaded into the same level, but diferent directories, in my GitHub Repro, SharePointPnP.PowerShell and OfficeDevPnP.Core and compiled both in Debug Mode.
I have attached to all of the PowerShell processes I can find.
I have put breakpoints in GetFeature.cs and PnPWebRetrievalsCmdlet.cs.
I have run Get-PnPFeature -Scope Web -Web https://xxxxx.sharepoint.com/collaboration
The above command fails "File Not Found" but no breakpoints were hit.
I repeat with command Get-PnPFeature -Scope Web -Web Collaboration.
This command works but still no breakpoints hit.
HAve I missed anything ?
Mar 13 2017 09:57 AM
Hi @Nigel Price,
How are you running your PowerShell commands?
I find deugging the easiest by running PowerShell in Visual Studio's PowerShell Interactive Window. Then simply connect your debugger to: PowerShellToolsProcessHost.
Then as long as your running code and source code match the debugger will pick up the breakpoints.
Mar 13 2017 11:09 AM - edited Mar 13 2017 11:46 AM
I was running the PowerShell from a PowerShell Window on the same VM as VS2017 is running.
I am trying to get the PowerShell Interactive Window displayingin VS2017, but no joy. (Cntrl + SHIFT + \).
The SharePointPnP.PowerShell.Commands Project is running in debug mode.
Regards
Nigel
Mar 16 2017 03:46 AM
Hi,
Make sure that type of code is set to "Managed v4.6..." not "Script" when attaching debugger.
It may be attached to "Script" type automatically, then need to change to Manual type selection
__
Br, Ivan
Mar 16 2017 04:24 AM