VS2017コミュニティでの作業では、この深刻な問題が発生しました。既存のプロジェクトを移植する場合、タグEmbedInteropTypesがまだ.csprojファイルにない可能性があるため、検索は無駄になります。その場合は、テキストエディタを使用して、プロパティグループDebug | x86(または使用する方)の最後にあるタグを.csprojに追加します。
前:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\MyProject.XML</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
後:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\MyProject.XML</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<EmbedInteropTypes>false</EmbedInteropTypes>
</PropertyGroup>
これは、ソリューションに属する すべてのプロジェクトで実行する必要があります。