How do I set a system-wide _ifdef?

This is using Microsoft Visual Stuedio version 2019 with C#.

If I want to add specialized code to a project shared by multiple software developers that is designed for my selfish tests and evaluation, how do I manage a # definition inside the C# code?

I imagine some soft of solution varable that is deined in either the project file or the solution file that I do not merge with the master branch of the code in the version contorl system. And then this "# define" is somehow blocked out in the source file.

Has anyone experienced or used such a thing?

I had an idea but then looked on the web with https://www.google.com/search?client=opera&q=system-wide+_ifdef%3F to discover others already commenting.

To pull this off, you never do something oddball. Put what you need in the code, submit it to the source management system you use (you didn't tell) and if you don't want it in the final build, use the usual VS debug build for your needs and then for production, your ifdef omits this code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.