Roslyn: "csc.exe" exited with code -2146232797 / Unit Test project / await on dynamic

Created on 30 Mar 2017  路  5Comments  路  Source: dotnet/roslyn

Version 14.0.25420.01 Update 3:

Steps to Reproduce:

  1. Create unit test project.
  2. Add the following class.
    [TestClass]
    public class Class1
    {
        public dynamic GetResponse()
        {
            return null;
        }
        public async void GetResponseTest()
        {
            var result = await GetResponse();
        }
    }
  1. Build the project.

Expected Behavior:
May be this is not the correct way of coding. But the other project types (class library project) compile successfully without an error.
Expecting to compile same as the class library project or give a compilation error with details to fix.

Actual Behavior:
Compile error only with the description.

"csc.exe" exited with code -2146232797

Area-Compilers Bug

All 5 comments

Thanks for taking the time to report this. Unfortunately I've been unable to reproduce this behavior. Tried on both Dev14 update 3 and Dev15 RTM but can't get the crash you've reported. Likely an issue with the set of references, compilation options being passed here.

Is there a minimal repro project that you can share out?

I could repro this with both VS2015.3 and VS2017

Microsoft.CodeAnalysis.CSharp.SyntheticBoundNodeFactory+MissingPredefinedMember: C:\UnitTestProject1\UnitTestProject1\UnitTest1.cs(17,24): error CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

The fix is to make sure Microsoft.CSharp.dll is part of all references passed to csc.exe (seems to be missing in UnitTest template)

@0xd4d ah good catch. Indeed that is the step I was missing.

This looks fixed in the latest internal build of Visual Studio. If there is no Microsoft.CSharp.dll, I get an error, but not a crash. Once reference is added, build succeeds.
In RTM there is a crash when there is no reference. Once reference is added the build succeeds.

TODO: add a test.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

glennblock picture glennblock  路  3Comments

DavidArno picture DavidArno  路  3Comments

codingonHP picture codingonHP  路  3Comments

MadsTorgersen picture MadsTorgersen  路  3Comments

OndrejPetrzilka picture OndrejPetrzilka  路  3Comments