help with shared code between 2 projects
is there a way to have shared code between 2 entirely separate .csprojs? for something like usings or the like
6 Replies
wdym for usings?
i like to store all my usings in 1 class like this;
i was wondering if there way any way to have these usings be shared between 2 projects, instead of each project having their own file for it
You can look into shproj s ?
Afaik that’s sorta the only way to have something that solves your issue
But idk it seems like a workaround to just copy-paste
not rlly even an issue, was just wondering if there was a better way to do it rather than having to copypaste yeah
you can add these global usings in the csproj
to share it for all your projects, you can put this inside a Directory.Build.props file, which will apply it automatically to your projects https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022
tyvm