corrupting golang file when saving in visual studio code - go

When I save a golang file in visual studio code, it ends up being corrupted -- characters are removed, not in any pattern I have discerned. This has occurred at various times in the past, but has just now recurred. For details, see my bug report, "corrupting file when saving in visual studio code #49465"1.
In the meantime, what I can do until it's fixed? Perhaps I could return to an older version of gopls, but I don't know how to do that.
Any suggestions welcome. I'm stuck until I can successfully save and run my go programs.
Thanks!

Please try running the following command
GO111MODULE=on go get golang.org/x/tools/gopls#master golang.org/x/tools#master
or
GO111MODULE=on go get golang.org/x/tools/gopls#v0.3.2-pre1

In order to make progress on my project, I've downloaded the prior version of go. At least on Windows, the downgrade installs like any upgrade, including offering to remove the existing version.
And I backed up gopls to its previous version using the facilities of VS Code:
ctrl+shift+X to access extensions
right-click on Go
select Install Another Version
wait...wait...wait...
when the list of versions finally appears, select the one you want (I went back a month)
So, the underlying problem still exists, but I'm back in business. I hope these instructions can help someone else battling with the disappearing character bug.

Related

Problems Installing VSCode to Windows 10

Can anyone help me out whilst I still have some hair left.
I have been running VSCode on Windows 10 since January. Yesterday it attempted to update to the latest version 1.54 but failed. VSCoce will now not run.
I am trying to re-install from the VSCode site installer. However when I download and run the installer file windows gives an error saying the file is corrupt.
Windows Error Message
I seem to remember having this problem when installing the 1.52 version in January but I can find no reference to what I did to resolve this. I believe I was pointed to an alternative install program, but I cannot find this now.
Please can anyone assist?
Many thanks.
Colin Murdoch.
OK. I have now managed to re-install VScode by downloading the .zip file and extracting all the elements into a directory within Program Files. It remains to be seen if this will work properly as with no official install routine, nothing will have been added to the registry. However the program loads OK and seems to recognise the PlatformIO extension that was already loaded.
I still don’t understand why I cannot run the official install routines. There must be something odd about my Windows installation.
check your antivirus program. I recognize that message. I had the same issue when trying to install an SQL server.

Program updating does not works properly

I have a program which has several versions. In the last version I have a problem: when I'm trying to update previous version to new one, the installer of new version removes files from previous version, but don't installs new files.
Just installing works fine, but updating process has this problem.
What can be the reason of this problem ?
Upade: I'll try to describe more detail
I have VS project where I have a project of program and an installer of this project. Till present all were working fine, but after my last big update ,the installer start work incorrectly.
And another question:
How I can debug installation process ?
I dont know which program you have. Generally programs have problems because of multible versions, because programmers arrange this. For example ;
Lets consider Microsoft Framework. If you have 4.5 you cannot install 4.0, so that with similar idea you cannot update it.
Try to delete other versions and update them and install others. Or you can also stop services which you dont want to update.Then other one will be updated without any problem.

Importing a project into Visual Studio. Why so many errors?

This isn't really coding specific, but we currently have a project that is live and working fine. I am tasked with making a few changes to it. I imported the ALL files of the project to Visual Studio 2010. I can't get any work done, because of all the errors!
Do you have any suggestions for me? The project doesn't have a source file, so I created a project and made one myself.
I tried another version of Visual Studio, and the errors continue. How in the world is this project even working?
Also, I have no way to speak with the creator.
Thanks for the help!
Josh
Without seeing the specific errors you're running into, I'm guessing that you are hitting one of two scenarios:
The source code references .NET assemblies that you do not have installed on your development machine. The only way to correct this is to get your hands on a copy of those assemblies to install them. The assembly names should be in the error messages, which would give you a good starting point to look from.
It's also possible that differences in the .NET framework versions that it was originally developed in and what you are trying to use now are accounting for a large number of errors. If the errors specifically reference the version number, this is most likely what you're experiencing. If this is the case, there are ways you can upgrade the individual file versions that your program references, but I honestly haven't done that in about 8 years, so I'm drawing a blank at the moment as to how to do it.
I don't understand ?
you have a "project" (what kind of project?) that you want to start working with with VS2010 ?
You add the files to a new VS2010 project and start building it and many errors occur ?
What kind of errors ? Language (C++/C#) errors ? missing include missing ? missing libraries ?
Can you show a some of the errors you get ?

Build failed... No build tools defined. AVR studio 4.19

When I tried to debug a small piece of code using AVR studio 4 I got this error:
Build failed... No build tools defined.
Could someone give me some advices?
In AVRStudio 4.19, Atmel made some serious changes from previous versions. Specially while using the toolchains. After you install WinAVR (the latest version, 2010...), open a new project in Avrstudio and from now on, everytime you make a new project you have to do this steps:
Go to "Project" tab
Go to "Configurations Options"
Then all the way down to "Custom Options".
Once you there, you'll see a checkbox called "Use AVR ToolChain", UNCHECK that option.(For some reason AVRStudio 4.19 does not link automatically the toolchain from WINAVR, so you have to do it manually).
After this, it enables the two options below.
For avr-gcc, you browse to the next direction: C:\ProgramFiles\WINAVR20100110\bin\avr-gcc.exe
For make, you browse to the next direction: C:\ProgramFiles\WINAVR20100110\utils\bin\make.exe
This directions depends on where did you installed WINAVR. I remember that the default location is "C:\" but when I installed WINAVR, I changed it to "ProgramFiles"
Click "OK".
After doing this steps, you should be able to compile and run your code.
Cheers, and hope it helped!
PD: I had that same problem, months ago. Check out, www.avrfreaks.net, very good webpage for newbies and pros at programming AVRs.
You need to install WinAVR or Atmel's "AVR Toolchain." If you already have one of these and still get this message, you may need to tweak the System Variables.
Connect the programmer first and then run avr studio.
I have that error when I try to open a project made in another version of AVR Studio (or upgraded to another version by someone else).

Make Visual Studio not care about DLL versions

Is there a way to make visual studio not care about dll versions? Is this a bad idea?
I am resetting up my dev machine and I just installed the latest version of Pex and Moles (version .92). All my projects are on version .91.
We are in the middle of a release and don't want to upgrade right now. Also, I cannot find an installer to version .91.
When I try to compile I get a message that I am missing the reference. (Hence this question)
The version is important.. By definition, there is a difference from each released version to the next (or there would be no need for a new version). Your program may not perform correctly if you are expecting one version and instead have another.
This was a part of what was known as "DLL Hell" in the pre-.NET days... If you needed to use a third party component (Crystal Reports Viewer is one we always had to deal with), you would just use the reference to whatever installed version was on the user's PC. Our retail locations had to have a specific version of Crystal Reports for their bookwork reports to print correctly, and because of that, we had to hold on to an old version forever.. Upgrading Crystal on the PC broke the vendor's bookwork app. On my first ever PC, I had several applications break when I would install or upgrade another. In particular, Real Player broke my telephone answering machine software. Goofy stuff like that...
So, the version IS important, even if it is an annoyance. It's also why I have a bias against third party tools that I have no code for, and can't recompile myself.
If you look at the properties of a referenced DLL, you will see a property "Specific Version". If you set it false, it doesn't track the specific version in the project file.
For this to work, you have to somehow fix the references where ever they are used. You can do this by opening every solution and fixing the references (at which time you could also just update the references to the correct version, paying heed to David's comments).
If you have a lot of solutions, you might use a tool like sed (see this post for windows versions of tool like this Is there any sed like utility for cmd.exe) to just update the project files as needed all at once.

Resources