相关疑难解决方法(0)

PowerShell说"在这个系统上禁用了脚本的执行."

我正在尝试运行从命令提示符调用PowerShell脚本的.cmd文件,我收到以下错误:

无法加载Management_Install.ps1,因为在此系统上禁用了脚本的执行.

我跑了cmd.exe,当我Management_Install.ps1从PowerShell 运行时,我Get-ExecutionPolicy回来了.

// Powershell的输出

PS C:\ Users\Administrator> get-executionpolicy

无限制

//从DOS输出

C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scr

ipts> powershell.\ Management_Install.ps1 1

警告:运行x86 PowerShell ...

无法加载文件C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\Management_Install.ps1,因为在此系统上禁用了脚本的执行.有关详细信息,请参阅"get-help about_signing".

在线:1个字符:25

  • .\ Management_Install.ps1 <<<< 1

    • CategoryInfo:NotSpecified:(:) [],PSSecurityException

    • FullyQualifiedErrorId:RuntimeException

C:\ Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts> pause

按任意键继续 ...

该系统是Windows Server 2008 R2.

我究竟做错了什么?

powershell windows-server-2008-r2

1545
推荐指数
30
解决办法
193万
查看次数

在调试期间在Visual Studio中自动附加到子进程

在为媒体中心编写插件时,你的插件会被托管在ehexthost.exe这个exe中ehshell.exe,你无法直接启动它,而是你传递了一个特殊的参数ehshell.exe,它将在一个单独的进程中启动插件.

当我们调试媒体浏览器时,我发现附加到第二个进程的过程有点笨重,我知道Debugger.Attach以及我可以使用的一些特殊注册表项.

这两种方法都不符合我的法案.我想要的是按F5并让我当前的visual studio实例自动附加到子进程.可以这样做吗?

如果有一个VS的插件允许我实现这个功能,我会很高兴.

编辑

我最终使用以下宏:

Public Sub CompileRunAndAttachToEhExtHost()

    DTE.Solution.SolutionBuild.Build(True)
    DTE.Solution.SolutionBuild.Debug()

    Dim trd As System.Threading.Thread = New System.Threading.Thread(AddressOf AttachToEhExtHost)
    trd.Start()

End Sub

Public Sub AttachToEhExtHost()
    Dim i As Integer = 0
    Do Until i = 50
        i = i + 1
        Try

            For Each proc As EnvDTE.Process In DTE.Debugger.LocalProcesses
                If (proc.Name.IndexOf("ehexthost.exe") <> -1) Then
                    proc.Attach()
                    Exit Sub
                End If
            Next
        Catch e As Exception
            ' dont care - stuff …
Run Code Online (Sandbox Code Playgroud)

.net c# debugging visual-studio visual-studio-debugging

36
推荐指数
3
解决办法
2万
查看次数

Visual Studio 2017在哪里存储其配置?

在VS 2015及更早版本中,设置存储在注册表中,例如HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0_Config.在VS 2017中,为了支持VS的多个实例,根据这篇文章,设置被移出了注册表.

根据这个SO答案,我以前一直在编辑注册表以在Windows处于高对比度模式时强制黑暗主题.现在我想在VS 2017中做同样的事情,但无法找到存储设置的位置,以进行此更改.

这些设置存储在Visual Studio 2017中的哪个位置?

visual-studio high-contrast visual-studio-2017

35
推荐指数
1
解决办法
1万
查看次数