locked
how do I fix an error i am getting when I hit enter. RRS feed

  • Question

  • I am editing a unity c# file. newest version of unity, and visual studios. It started happening after I downloaded a plugin, accidentally uninstalled another plugin, don't remember what it was called.

     The error

    unable to cast object of type 'microsoft.CodeAnalysis.CSharp.CompilationUnitSyntax' to type 'Microsoft.CodeAnalysis.VisualBasic.Syntax.CompilationUnitySyntax'.

    It only does it with unity scripts so far. I completely reinstalled visual studios, and updated unity, what do I do next?

    Saturday, July 16, 2016 9:57 PM

Answers

  • Hi 78Star,

    According to the error message, the problem should caused in your C# code where you convert the 'microsoft.CodeAnalysis.CSharp.CompilationUnitSyntax' type to 'Microsoft.CodeAnalysis.VisualBasic.Syntax.CompilationUnitySyntax' type, which is not supported. So please check your code first to confirm the type conversion is supported or not.

    >> It started happening after I downloaded a plugin, accidentally uninstalled another plugin, don't remember what it was called.

    When do you get this error? You mentioned when you hit enter in your thread title, please provide the detailed information about how and where do you hit the enter causes this issue.

    Since you don't remember which plugin you installed and uninstalled, I suggest you configure your Visual Studio to let it can create Unity C# file and then create a new project to check whether it also has this issue.

    And the error message mentioned CompilationUnitySyntax in CSharp and VisualBasic, so please check which plugin is support this type and then install this plugin.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 18, 2016 3:39 AM