Visual Studio 2013中的调用目标抛出异常

13 windows sql-server environment-variables visual-studio ilspy

今天,当我打开时Visual Studio 2013 Professional Edition,我收到了错误exception has been thrown by a target of invocation.

此外,我试图打开ILSpy调试一个DLL,但它崩溃了.我认为它可能来自同一个杀手.对于我所做的系统,我SQL Server 2012昨天安装了专业版.

我检查了环境路径.它是:

C:\ Program Files\Common Files\Microsoft Shared\Windows Live; C:\ Program Files(x86)\ Common Files\Microsoft Shared\Windows Live; C:\ Program Files(x86)\ Intel\iCLS Client \; C:\Program Files\Intel\iCLS Client \; c:\ Program Files(x86)\ AMD APP\bin\x86_64; c:\ Program Files(x86)\ AMD APP\bin\x86;%SystemRoot%\ system32;%SystemRoot %;%SystemRoot%\ System32\Wbem; c:\ Program Files(x86)\ ATI Technologies\ATI.ACE\Core-Static; C:\ Program Files\Intel\Intel(R)Management Engine Components\DAL; C:\Program Files\Intel\Intel(R)Management Engine Components\IPT; C:\ Program Files(x86)\ Intel\Intel(R)Management Engine Components\DAL; C:\ Program Files(x86)\ Intel\Intel( R)管理引擎组件\ IPT; C:\ Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5 \; C:\ Program Files(x86)\ NTRU Cryptosystems\NTRU TCG Software Stack\bin \; C:\ Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin \; C:\ Program Files(x86)\ Windows Live\Shared; c:\ Program Files(x86)\ Microsoft SQL Server\100 \工具 s\Binn \; c:\ Program Files\Microsoft SQL Server\100\Tools\Binn \; c:\ Program Files\Microsoft SQL Server\100\DTS\Binn \; C:\ Program Files(x86)\ Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE \; C:\ Program Files(x86)\ Microsoft SQL Server\100\DTS\Binn \; C:\ Program Files(x86)\ Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies \; C:\ Program Files\Microsoft\Web Platform Installer \; c:\ Program Files(x86)\ Microsoft ASP.NET\ASP.NET Web Pages\v1.0 \;%systemroot%\ System32\WindowsPowerShell\V1.0 \; C:\源\猎户座\行李箱\包\ NuGet.CommandLine.2.2.0 \工具;%TFSPowerToolDir%;%BPADir%;%HummPATH14%;%SYSTEMROOT%\ SYSTEM32\WindowsPowerShell\V1. 0 \; C:\ Program Files(x86)\ QuickTime\QTSystem \; C:\ Program Files(x86)\ Windows Kits\8.1\Windows Performance Toolkit \; C:\ Program Files\Microsoft SQL Server\110\DTS\Binn \; C:\ Program Files(x86)\ Microsoft SQL Server\110\Tools\Binn \; C:\ Program Files\Microsoft SQL Server\110\Tools\Binn \; C:\ Program Files(x86)\ Microsoft SQL Server\110\Tools\Binn\ManagementStudio \; C:\ Program Files(x86)\ Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies \; C:\ Program Files(x86)\ Microsoft SQL Server\110\DTS\Binn \

我的操作系统是Windows 7 64位.

activitylog.xml具有:

 <entry>
    <record>25</record>
    <time>2014/05/13 15:06:11.756</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [Environment Package Window Management]</description>
    <guid>{5E56B3DB-7964-4588-8D49-D3523AB7BDB9}</guid>
</entry>
<entry>
    <record>26</record>
    <time>2014/05/13 15:06:11.756</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [Environment Package Window Management]</description>
    <guid>{5E56B3DB-7964-4588-8D49-D3523AB7BDB9}</guid>
    <hr>80131534</hr>
    <errorinfo>The type initializer for 'Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService' threw an exception.</errorinfo>
</entry>
Run Code Online (Sandbox Code Playgroud)

小智 21

谷歌搜索并得到答案. 回答

我的环境太长了环境变量PATH,在缩短了2048个字符之后问题就解决了.

  • 我还发现这篇文章很有帮助,因为它包含了一个比你链接到的答案更详细的描述和截图:http://www.dirkstrauss.com/programming/exception-thrown-target-invocation (3认同)

RAY*_*RAY 12

  1. 打开C:\ Windows\System32\SystemPropertiesAdvanced.exe
  2. 打开"高级">"环境变量".
  3. 在"系统变量"下,找到"路径"条目.
  4. 复制里面的值.
  5. 研究路径的内容并查找一些长而重复多次的路径.目的是用另一个变量替换它.在此输入图像描述

6,添加一个新的系统变量条目,表示#5中的条目.
在这种情况下," C:\ Program Files\Microsoft SQL Server "重复了10次,因此我的目标是被解决


%sql% for
" C:\ Program Files\Microsoft SQL Server "

  1. 更新#3中找到的路径条目中的路径.如

之前:
c:\ Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn \;


%sql%\Client SDK\ODBC\110\Tools\Binn \;之后