Cannot drag and drop items from toolbox in Visual studio

417 views Asked by At

The problem that I cannot drag and drop items from toolbox in Visual Studio in C# project .

When I am trying to drag from the toolbox, this error shows up:

enter image description here

And when I am trying to move any component inside the Design Form with the mouse, it's not moved, it only works if moved by pressing arrow keys:

enter image description here

And when I open the project this error shows up:

enter image description here

I tried

  1. Reset toolbox
  2. Repair toolbox
  3. Delete the file C:\Users\user\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml
  4. Uninstall Visual Studio and reinstall it
1

There are 1 answers

3
Node defender On

These two errors are not caused by the same issue.

1. Regarding "the operation could not be completed.

The system cannot find the file specified", it is because Visual Studio cannot correctly select the .NET Framework.

You can use the Visual Studio installation tool to uninstall the .net framework you are using and then reinstall it.

If it still doesn't work, please try to cd to the directory of devenv.exe from the command line. For example, my devenv.exe is located in

C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE

I just type cd C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE

Then execute the command

Devenv.exe /resetsettings

Wait for vs to open and close

Devenv.exe /SafeMode

Wait for vs to open and close

However, some personal settings will be lost in this way, such as External Tools in customized tools, so be sure to back them up.

2. For "The 'ORMDataModelPackage' package did not load correctly".

It's because the Microsoft.VisualStudio.Modeling.Sdk.Shell.15.0 assembly is missing. Usually after closing and opening Visual Studio this error will not appear again. If it doesn't work, please run the Visual Studio installer and install the DSL-Tools component.