如何解决错误“'__'的类型初始化程序引发异常” [英] How to solve an error "the type initializer for '__' threw an exception"

查看:90
本文介绍了如何解决错误“'__'的类型初始化程序引发异常”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试从Visual Studio 2010打开现有项目时



错误:Microsoft.VisualStudio.Build.ComInteropWrapper.ProjectShim的类型初始化程序抛出了例外。



Visual Studio 2012



错误:工具版本4.0无法识别。可用的工具版本是12.0,2.0,3.5。



.vbproj文件显示toolversion为4.0



i尝试将转换改为4.5并且无法从VS2012打开。



当我进入注册表时,我看到工具版本12.0,2.0,3.5 ,4.0安装。



When I tried to open an existing project From Visual Studio 2010

error : The type initializer for 'Microsoft.VisualStudio.Build.ComInteropWrapper.ProjectShim' threw an exception.

Visual Studio 2012

error : The tools version "4.0" is unrecognized. Available tools versions are "12.0", "2.0", "3.5".

the .vbproj file shows toolversion as 4.0

i tried to change tooversion to 4.5 and could not open from VS2012.

When I go to registry, I see tool versions 12.0, 2.0,3.5,4.0 installed.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://ift.tt/PiGwmX">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>
    </SchemaVersion>
    <ProjectGuid>{}</ProjectGuid>
    <ProjectTypeGuids>{}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <RootNamespace>abcd</RootNamespace>
    <AssemblyName>abcd</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <MyType>Custom</MyType>
    <UseIISExpress>false</UseIISExpress>
  </PropertyGroup>





在VS 2010上我得到了与新项目相同的错误Microsoft.VisualStudio.Build.ComInteropWrapper.ProjectShim的类型初始化程序引发了异常。创建网站不是问题。



我卸载VS2010,并重新安装它,发生同样的错误。



我尝试了什么:



老实说,我不知道因此还没有尝试过。请指导我。谢谢!



On VS 2010 I get the same error for new project The type initializer for 'Microsoft.VisualStudio.Build.ComInteropWrapper.ProjectShim' threw an exception. Creating website is not an issue.

I uninstalled VS2010, and reinstalled it, same error occurs.

What I have tried:

Honestly, i have no idea therefore tried nothing yet. please guide me through. thank you!

推荐答案

(配置)'=='' > 调试< /配置 >
< 平台 条件 = '
(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '


(平台)'=='' > AnyCPU < /平台 >
< ProductVersion >
< < span class =code-leadattribute> / ProductVersion >
< SchemaVersion >
< / SchemaVersion >
< ProjectGuid > {} < / ProjectGuid >
< ProjectTypeGuids > {} < / ProjectTypeGuids >
< OutputType < span class =code-keyword>> 库< / OutputType >
< RootNamespace > abcd < / RootNamespace >
< AssemblyName > abcd < / AssemblyName >
< TargetFrameworkVersion > v4.0 < / TargetFrameworkVersion >
< MyType > 自定义< / MyType >
< UseIISExpress > false < / UseIISExpress >
< / PropertyGroup >
(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion> </SchemaVersion> <ProjectGuid>{}</ProjectGuid> <ProjectTypeGuids>{}</ProjectTypeGuids> <OutputType>Library</OutputType> <RootNamespace>abcd</RootNamespace> <AssemblyName>abcd</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <MyType>Custom</MyType> <UseIISExpress>false</UseIISExpress> </PropertyGroup>





在VS 2010上,新项目出现相同的错误Microsoft.VisualStudio.Build.ComInteropWrapper.ProjectShim的类型初始化程序引发异常。创建网站不是问题。



我卸载VS2010,并重新安装它,发生同样的错误。



我尝试了什么:



老实说,我不知道因此还没有尝试过。请指导我。谢谢!



On VS 2010 I get the same error for new project The type initializer for 'Microsoft.VisualStudio.Build.ComInteropWrapper.ProjectShim' threw an exception. Creating website is not an issue.

I uninstalled VS2010, and reinstalled it, same error occurs.

What I have tried:

Honestly, i have no idea therefore tried nothing yet. please guide me through. thank you!


这篇关于如何解决错误“'__'的类型初始化程序引发异常”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆