Method signature has invalid calling convention from a csproj file (0x80131239)

0

Until today one of our applications was running correctly in Visual Studio code (the majority of devs use Visual Studio 2019). However, after a pull from git this morning we are getting the following error when building the project.

dotnet build

C:\Program Files\dotnet\sdk\3.0.100\Roslyn\Microsoft.CSharp.Core.targets(59,5): error : Process terminated. System.Runtime.InteropServices.COMException (0x80131239): Method signature has invalid calling convention. (0x80131239) [<MyDiirectory>\<MyProject>.csproj]
C:\Program Files\dotnet\sdk\3.0.100\Roslyn\Microsoft.CSharp.Core.targets(59,5): error :    at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseLocalDeclarationStatement(SyntaxToken awaitKeywordOpt) [<MyDiirectory>\<MyProject>.csproj]
C:\Program Files\dotnet\sdk\3.0.100\Roslyn\Microsoft.CSharp.Core.targets(59,5): error :    at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParsePossibleDeclarationOrBadAwai  tStatement(ResetPoint& resetPointBeforeStatement) [<MyDiirectory>\<MyProject>.csproj]
C:\Program Files\dotnet\sdk\3.0.100\Roslyn\Microsoft.CSharp.Core.targets(59,5): error :    at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParsePossibleDeclarationOrBadAwaitStatement() [<MyDiirectory>\<MyProject>.csproj]

The actual csproj file is nothing out of the ordinary:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <Nullable>enable</Nullable>
    <LangVersion>8.0</LangVersion>
  </PropertyGroup>

 <ItemGroup>
    <Reference Include="System.ComponentModel.Annotations">
      <HintPath>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\ref\netcoreapp2.2\System.ComponentModel.Annotations.dll</HintPath>
    </Reference>
 </ItemGroup>

  <ItemGroup>
    <Folder Include="Report\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
    <PackageReference Include="SolrNet.Core" Version="1.0.19" />
  </ItemGroup>

I've tried the following:

  • Complete clean and rebuild
  • Clear the proj file and recreate
  • Restart of VS code
  • Checked for legacy DLL references

Has anyone come across this problem, specifically in Visual Studio code? As I say it works fine on Visual Studio 2019.

.net-core
visual-studio-code
asked on Stack Overflow Jan 6, 2020 by Andrew • edited Jan 6, 2020 by Andrew

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0