I got error "The 'CSharpPackage' package did not load correctly" when I open sln and I can not debug cs file

Wongsathorn Phorit 1 Reputation point
2021-05-13T13:01:53.997+00:00

To day I upgrade visual studio 2019 to the lastest version.
and I always got error "The 'CSharpPackage' package did not load correctly" when I open sln and I can not debug cs file ( cannot add breakpoint in any way )
like this

96308-screenshot-2021-05-13-193836.png

and this is my log

96411-activitylog.xml

I try to fixed this by delete all file in ComponentModelCache and restart program, repair , uninstall and then install again
but it won't work.

Does anyone have any idea for this error ?

Developer technologies | Visual Studio | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Duane Arnold 3,216 Reputation points
    2021-05-13T13:18:18.23+00:00

    MS Q and A has a Visual Studio General tag that you can post to for help.


  2. Tianyu Sun-MSFT 34,441 Reputation points Microsoft External Staff
    2021-05-14T06:23:34.717+00:00

    Hello @Wongsathorn Phorit ,

    Welcome to Microsoft Q&A forum.

    Did you install some extensions, NuGet packages in your solution(project)? Does this issue appear in a newly created project?

    Please try following steps to troubleshoot:

    1). Close all VS instances and delete the hidden .vs folder and bin, obj folders in your project/solution folder, after that restart VS and rebuild your project.

    2). If you didn’t delete all ComponentModelCache folders in every C:\Users\[user name]\AppData\Local\Microsoft\VisualStudio\16.0_XXXXX folders, please try to delete all other ComponentModelCache folders.

    3). If you have installed some (third-party)extensions in VS, please try to disable them temporarily from VS > Extensions > Manage Extensions > Installed > Disable, then restart VS and check again. Or you can open Developer Command Prompt for VS 2019 > type devenv /safemode to start VS under safe mode to see if the same issue appears(under safe mode, some components/extensions may not work).

    4). Try to reboot your machine and open VS as administrator.

    5). If above suggestions don’t work, please kindly report this issue to VS Product Team in our Developer Community from VS > Help > Send Feedback > Report a Problem…

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.