VS 2019: running an extensibility project (VSX) always compiles an unknown external project - vsix

Basically this:
I created a fresh project in Visual Studio 2019 using the VSX c# template.
I moved a bunch of files from an older VSX project (for VS 17).
I compiled and ran the project - errors started emerging.
I addressed one error, ran the project - got another error.
I started addressing the second error and in the process of fixing it I noticed that now VS is for some reason compiling an unknown external project whenever I run my project. I realized it because once the program hit the error and instead of jumping into my code and showing me the line, it showed me this message: "The source file is different from when the module was built. Would you like the debugger to use it anyway?" Also whenever I changed something in my code files now - the changes never apply. Moreover, the first error (which I have already fixed) resurfaced again, and when the debugger tried showing me the place of the error - it clearly used the new file, thinking that it's an old one (even if I change the new file to have empty space in the line where the error was, the debugger will still stand on that empty line, talking about the error).
Now whenever I create a new VSX project, even an empty one, and compile/run it - the studio runs that unidentified external project (I have absolutely no clue where that project is, even the files that the debugger uses have no influence on that project.
UPDATE: I deleted Visual Studio cache folders (C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\16.0_xxxx) as well as reset the experimental Visual studio with the start menu prompt "Reset Visual Studio 2019 Experimental Instance". Now, when I compile my VSX projects, a clean and empty Visual Studio instance is launched - my extension code is ignored.

Related

Visual Studio 2022 - Publish database project locally, get message saying the Site.dacpac file is missing, and rebuild always skips

I am at a new role, and am trying to get started with the Visual Studio solution I will be working on - I am having an issue with the sqlproj within the solution - which is required to get my local instance up and running!
The issue is the publish step - I get the error "Could not find the file c:\Repos<whatever>\debug\bin\Site.dacpac.
Several different sources have suggested simply doing a Rebuild of the project, but VS always skips this project - even if I try a Clean first, or Clean the entire solution and Build after.
I have checked that the build is currently set to produce Debug code, and confirmed the project is set to be built in the Debug/All CPUs configuration.
Is there a way to force it to rebuild?
The only thing that I can think of is that the instructions I'm following request the developer to install SQL Server 2017, but I'd already installed SQL Server 2019 - could there be an issue there?
Resolved: for some reason the sql project didn't want to work with SQL 2019,
so I uninstalled that, and replaced with SQL 2017, and it worked.
I had expected '19 to be backwards compatible with '17, but apparently not.

Visual Studio Code does not see changes in F# Solution

Currently I am trying to use Visual Studio Code with Ionide to build a F# Solution. To describe my problem, i first describe what i have done, and what works.
I created a solution with two Projects. One Project is a Queue that contains a F# library. Another project is Queue.Test that is a console application that uses the Queue library, and should contain the Tests for the Queue library.
I'm using .Net6 and created the solution and Project with the dotnet cli tool.
In general, i can build the project with dotnet and i also can use everything in Visual Studio Code. I load the Folder that contains both projects, and Visual Studio Code loads the library.
I am able to edit the Library and my Console application. In my Console application i also can access the Queue and so on. Autocompletion works, and so on.
But, there is one problem. When i add a new function to my library, let's say Queue.help then in my Console application, i cannot see that function. It doesn't show in autocomplete, and when I write code that uses that function i get a compiler error telling me that function doesn't exists.
I can Build/Rebuild from VS Code or from CLI but the problem goes not away.
The only way Ionide starts to see the new function is by building the library AND restarting VS Code. As long i don't restart, it seems to not update the generated dll (i guess).
This is sure annoying, as i don't want to reload/restart VSCode everytime I add a new function to my library.
So my question: How i can I fix this?
What i want is to be able to change my library, and at the same time write tests in the other project and get full Code autocompletion.
Does somebody else have the same problem, or should I change my workflow?
What can i do, to debug this problem on my own?
Some tips?
This issue is fixed by the recent version of Ionide 5.10.1

Project Template Not Updating on Build

I've been working on a project template today, first time doing so but it has been going alright. I'm almost finished but have now run into some weird issue I can't figure out.
For some reason which I don't know, whenever I try and debug my project template it is now stuck to using some old version of it. No matter what or how much I change then rebuild and try to debug - it still uses some weird old version stuck in some sort of limbo.
I can't seem to figure out where it's finding this file, I've cleared my temp folder. It doesn't show up as installed when I go to Manage Extensions in Visual Studio.
Any ideas what might have happened? There are no errors or warnings.
I was able to solve this by deleting all files inside %LOCALAPPDATA%\Microsoft\VisualStudio\16.0_cfa111feExp\Extensions. After doing so, I restarted VS and loaded up my project and rebuild (not build) the solution.
After that, it now shows the up-to-date version of the project template. What caused this and how to potentially prevent it in the future - I still have absolutely no idea.
I use Visual Studio 2019 Version 16.4.2

Allegro 5 - Cosmic Protector Demo

I'm new to C++ and Allegro 5 but have been able to follow tutorials online and am able to build and compile several smaller projects successfully.
I cannot however get the demo project named Cosmic Protector to run and would like to at least learn what is wrong.
Unfortunately, I can't give you much to go on.
A window opens briefly and then closes, leaving the console open with the message..
process 6400 exited with code 255
If you have this demo running in VC 2017 with the latest release of Allegro 5 (5.2.4) installed via Nuget, I'd like to know that even.
The source for this program is available at...
https://github.com/liballeg/allegro5/tree/master/demos/cosmic_protector
Thank you, Jack
The allegro example programs and demos are usually built with CMake alongside the Allegro library. I just tested the CMake build of Allegro 5 with VS2017 on Windows 10 and it builds the Cosmic Protector demo successfully. You have to move the allegro dlls into the same directory as the exe, but other than that it runs perfectly.
As to why it's not working for you, cosmic protector depends on a data directory that holds it's resources. The working directory may be wrong, which would cause it to be unable to find resources. The data dir needs to be copied alongside the executable.
You can set the working directory to $(OutDir) under Debugging in Project->Properties and then it should find any data in the same directory as the exe.
How are you building cosmic protector?
Thanks to BugSquasher, I now have this working.
Here's how...
Start Visual Studio 2017
Create New Project of type Windows Console Application.
Name project CosmicProtector and save it in appropriate place on my HDD.
Disable precompiled headers and delete the any .h and .cpp
files associated with the new project regarding precompiled headers.
(for example pch.h)
Install Allegro 5.2.4 via Nuget.
In Visual Studio, navigate to Project Settings/Properties and ensure all
Allegro addons are enabled.
Copy the Cosmic Protector SRC and Header files and paste them into my
project directory.
Next in Visual Studio Project, Add the Source and Header files
respectively.
Rather stupidly, the step I had missed and that your reply brought my attention to was...
Copy the data directory and paste this into my project directory in the
applicable location.
Now build...
The project built right away, except for some errors reported in Game.cpp, GUI.cpp and Render.cpp
One error in Game.cpp, this being an instance of...
error C4996 'snprintf': This function or variable may be unsafe. Consider using snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address this I have changed the instance of snprintf to sprintf_s.
Three errors in GUI.cpp, were instances of...
Error C4996 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address all of these I changed each instance of strcpy to strcpy_s.
And one error in GUI.cpp, this being an instance of...
error C4996 'snprintf': This function or variable may be unsafe. Consider using snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address this I have changed the instance of snprintf to sprintf_s.
One error in Render.cpp, this being an instance of...
error C4996 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address this I have changed the instance of sprintf to sprintf_s.
Then build and it works:)
Thank you so much for your reply as I had moved on to other things but will find it very useful I think being able to build and run this demo.
It's only your reply that has brought me back to it and this time, I am successful:)

Existing project full of errors in Visual Studio Code

I've received a simple VS Code console project and I intended to open it in my VS Code.
When I opened the Program.cs file, a notification appeared that I needed to restore the packages.
After it is done, every line is full of errors - yet the project compiles and runs.
Is this a bug?
UPDATE:
As of version 1.31.1, it is still an issue.
The contradiction between all the errors and the successful build…
It still looks like a garage project, even after 1-2 years of development...