Object reference not set on object instance + paste with Ctrl-V or Mouse

In VS 2013, I get "Object reference not set to object instance" when I paste text into a specific cshtml file. Removed the solution, restarted VS and the error still happens.

It doesn't matter how much text is inserted. The problem does not occur in other solutions

I have read other questions regarding this error and none are applicable. Any ideas?

+3


source to share


4 answers


I found a fix for this error, I just opened the solution file from windows explorer directly .sln

, not from the start page Visual Studio

.



+4


source


I am assuming your keyboard buffer contains only text.

If this is the case and you are not getting this error when editing other files and / or files in other solutions - it may be because the particular file has some form of "corruption".



It happened to me a few months ago. I finally copied the text of the file to another file and deleted the original. In this case, he did a great job.

Irritating. Hope this helps ...

0


source


It can be linked to the code editor used for the current file. Try right-clicking the file in Solution Explorer and select "Open With" and then select the code editor you want. See if that helps, you can also do this by default. It helped me with the same problem in .cs files, I chose CSharp Editor instead of standard CSharp form editor .

0


source


The only way I can fix it is to restart Visual Studio, sorry.

0


source







All Articles