C
C#6mo ago
Rhythmic

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
Rhythmic
Rhythmic6mo ago
Ideally, the external folders should be visible in the solution explorer, and shouldn't be included in the git repository.
Anu6is
Anu6is6mo ago
You could try using add existing item in solution explorer
Rhythmic
Rhythmic6mo ago
I tried this, but it seems to only be individual files, not directories
Anu6is
Anu6is6mo ago
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
Rhythmic
Rhythmic6mo ago
Maybe I can create a new csproj in the directory of the .cs files?
Anu6is
Anu6is6mo ago
Does the directory just have a bunch of standalone cs files?
Rhythmic
Rhythmic6mo ago
pretty much yeah in subfolders
Anu6is
Anu6is6mo ago
Hmmmm Could probably make a class library project out of them and reference that
Rhythmic
Rhythmic6mo ago
ok I'll look up how to do this
Mayor McCheese
Mayor McCheese6mo ago
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.