Reputation: 505
I'm creating PowerShell module in VS 2012. So for comfortable debugging in debug project properties I set Start action to start external program PowerShell.exe and in command line arguments I want to add -Command { Import-Module [MyDllFileName] }. What should I write instead of [MyDllFileName]? There should be my compiled dll.
Upvotes: 0
Views: 1338
Reputation: 35901
The answer propsosed in the linked question is still pretty much valid, but you have to think it through a bit.
First of all the actual answer remains: it's simply not possible to get the assembly name onto the debug command line using the project settings.
Second there are a couple of things you can do however:
The debugger command line is stored in the projectname.vcxproj.user file as the LocalDebuggerCommandArguments
property. Write a script/extension/... to set that property to $(TargetPath)
and off you go.
Based on the solution propsed in the other question: use an external tool with something like devenv /DebugExe powershell.exe - Command { Import-Module $(TargetPath) }
.
Like 2, but place a DebugBreak()
statement somwhere in your dll and just launch PowerShell, it will coma and ask to attach the debugger when it sees DebugBreak/add.
Upvotes: 1