Add external folders to solution
I have a program which can run .cs files that aren't a part of the source code. These are essentially customizable algorithms in which certain methods from the source code are run.
Since the directory containing these external .cs files aren't part of the source code, they're not in the project solution, so IntelliSense doesn't work when editing these files, which is impractical.
Is there a way to enable IntelliSense for these directories, such that I can Ctrl+Click on methods to go to their definitions in the source code?
My solution so far is to copy all the files to a folder inside the solution, which is impractical because it isn't synchronized with the external folder and now stores all the files twice.
I'm using Visual Studio Community 2022.
10 Replies
Ideally, the external folders should be visible in the solution explorer, and shouldn't be included in the git repository.
You could try using add existing item in solution explorer
I tried this, but it seems to only be individual files, not directories
And add the files/folder to git ignore
Ah, usually I use it for adding projects which only requires you to add the csproj so can't speak to adding a directory itself, sry
Maybe I can create a new csproj in the directory of the .cs files?
Does the directory just have a bunch of standalone cs files?
pretty much yeah
in subfolders
Hmmmm
Could probably make a class library project out of them and reference that
ok I'll look up how to do this
You have to tell the solution about these files. There's not a way not to include that change in the repo. You can point to files outside of the repo, but still it's a solution file edit.