I have noticed that when i copy and paste code, either from a visual studio project or from the net, causes errors.
like it seems to have additional information in the copy,a bit like pasting word documents into a html editor online.
As far as I know, you can copy the code from the visual studio project to another, there is no additional information, but if you copy the code from the word document, some website, there may be additional information.
You can try to paste the copied information on the text, to see if there is additional information, and then paste and copy.
Best regards,
Sam
IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
How did you copy JWTHeader? From which browser? On which page? How did you select the text that you copied (double-click to select a word or click and drag to make selection? or some other method?) When you paste what you copied into Notepad, what do you
see?
What program is 'vs'? Full name and version from 'Help'- 'About'
What is the definition of 'ctrl an p'? On my copy of 'Visual Studio Community 2019, ctrl-p is a shortcut to file->print.
BTW - When I tried to get the version information for my installation of Visual Studio there was no response and I could not open any menu at all with Visual Studio. Running 'Repair' fixed the problem. Have you done any basic debugging for your problem?
i copied class names from both browsers and other projects opened in another instance. it happens on many pages many times. i used ctrl and c and ctrl and v,pasting into notpad just shows text
vs should be vs code= visual studio code v 1.45.1
don't know what the terminologuy is but ctrl p opens up a textbox to allow yoou to search for files
its normally just the thing i have copied and pasted that causes the issue, repair seems extreme,dotnet clean and restore and sometimes build sometimes work sometimesi have to delete the text andtype it which can be annoying.
You might want to share this on VS Code Issues; https://github.com/microsoft/vscode/issues. It's probably something to do with encoding. You might try, as suggested above, pasting into a text editor
like notepad or notepad++ to strip non ACSII characters. In the case of notepad++ view the actual hex code. Then paste from notepad to VS Code. If that works then there is probably a setting in VS code that will fix this issue.
Can you share a web site that causes this copy/paste issue and the steps to reproduce?
Can you give an exact sequence of keystrokes that you use that reproduces the problem? Give an exact example of which web browser you are using, exactly which web page you are browsing, exactly how you select the text you are copying, etc, etc - all the
precise details. Of course, the gold standard is an example that anyone can reproduce. It is hard to fathom what ctr+p has to do with a copy and paste operation.
The problem is that copy and paste works millions (or billions?) of times a day for developers all over the world using VSCode. If it doesn't work for you then it must be something very specific about what you are doing or your source or your destination
or your configuration. I certainly wouldn't think of repair as 'extreme' in this sort of circumstance. So, you should be extremely precise in detailing exactly what it is that you do, exactly what your source is, exactly what the destination is and exactly
what your configuration is. If we can't reproduce from your precise description then it would point towards some sort of corruption in your environment (project files or tools).
Participant
1861 Points
2836 Posts
vs copy and paste issues
May 28, 2020 11:28 PM|EnenDaveyBoy|LINK
hi
I have noticed that when i copy and paste code, either from a visual studio project or from the net, causes errors.
like it seems to have additional information in the copy,a bit like pasting word documents into a html editor online.
is there a way to stop this.
Contributor
3370 Points
1409 Posts
Re: vs copy and paste issues
May 29, 2020 01:37 AM|samwu|LINK
Hi EnenDaveyBoy,
As far as I know, you can copy the code from the visual studio project to another, there is no additional information, but if you copy the code from the word document, some website, there may be additional information.
You can try to paste the copied information on the text, to see if there is additional information, and then paste and copy.
Best regards,
Sam
Participant
1660 Points
952 Posts
Re: vs copy and paste issues
May 30, 2020 11:42 PM|PaulTheSmith|LINK
Detail, Detail and Detail
Could you expand a little on "causes errors"? Show the code, show the error, show the steps to reproduce.
Participant
1861 Points
2836 Posts
Re: vs copy and paste issues
May 31, 2020 12:49 PM|EnenDaveyBoy|LINK
an example is i have just copied "JWTHeader" from a browser.
i type
var foo = new and ctrl an p so it red
var foo = new JWTHeader then added brakets and the semi colon.
but it has a red wavey line and said cannot be found.
I made sure all the packages where in place, still the error,hovered over sid couldnot be found, ctrland . nothing.
yet if i delete it and type it in its found,spelling was the same layout was the same.
Participant
1660 Points
952 Posts
Re: vs copy and paste issues
Jun 01, 2020 12:34 AM|PaulTheSmith|LINK
How did you copy JWTHeader? From which browser? On which page? How did you select the text that you copied (double-click to select a word or click and drag to make selection? or some other method?) When you paste what you copied into Notepad, what do you see?
What program is 'vs'? Full name and version from 'Help'- 'About'
What is the definition of 'ctrl an p'? On my copy of 'Visual Studio Community 2019, ctrl-p is a shortcut to file->print.
BTW - When I tried to get the version information for my installation of Visual Studio there was no response and I could not open any menu at all with Visual Studio. Running 'Repair' fixed the problem. Have you done any basic debugging for your problem?
Participant
1861 Points
2836 Posts
Re: vs copy and paste issues
Jun 01, 2020 11:23 PM|EnenDaveyBoy|LINK
i copied class names from both browsers and other projects opened in another instance. it happens on many pages many times. i used ctrl and c and ctrl and v,pasting into notpad just shows text
vs should be vs code= visual studio code v 1.45.1
don't know what the terminologuy is but ctrl p opens up a textbox to allow yoou to search for files
its normally just the thing i have copied and pasted that causes the issue, repair seems extreme,dotnet clean and restore and sometimes build sometimes work sometimesi have to delete the text andtype it which can be annoying.
All-Star
53721 Points
24048 Posts
Re: vs copy and paste issues
Jun 01, 2020 11:46 PM|mgebhard|LINK
You might want to share this on VS Code Issues; https://github.com/microsoft/vscode/issues. It's probably something to do with encoding. You might try, as suggested above, pasting into a text editor like notepad or notepad++ to strip non ACSII characters. In the case of notepad++ view the actual hex code. Then paste from notepad to VS Code. If that works then there is probably a setting in VS code that will fix this issue.
Can you share a web site that causes this copy/paste issue and the steps to reproduce?
Participant
1660 Points
952 Posts
Re: vs copy and paste issues
Jun 02, 2020 02:21 AM|PaulTheSmith|LINK
Can you give an exact sequence of keystrokes that you use that reproduces the problem? Give an exact example of which web browser you are using, exactly which web page you are browsing, exactly how you select the text you are copying, etc, etc - all the precise details. Of course, the gold standard is an example that anyone can reproduce. It is hard to fathom what ctr+p has to do with a copy and paste operation.
The problem is that copy and paste works millions (or billions?) of times a day for developers all over the world using VSCode. If it doesn't work for you then it must be something very specific about what you are doing or your source or your destination or your configuration. I certainly wouldn't think of repair as 'extreme' in this sort of circumstance. So, you should be extremely precise in detailing exactly what it is that you do, exactly what your source is, exactly what the destination is and exactly what your configuration is. If we can't reproduce from your precise description then it would point towards some sort of corruption in your environment (project files or tools).
Participant
1861 Points
2836 Posts
Re: vs copy and paste issues
Jun 02, 2020 10:17 PM|EnenDaveyBoy|LINK
i will try and remember the processes next timeit happens,and then report it the issues link.
Thanks for the help.