Using #define from file
-
18-10-2022 - |
Question
I got to know that to define a symbol visible in all files we can make an entry of #define
in build of each project under Conditional compilation symbols
.
Procedure to manually add it :
You can manually edit the .csproj file using Visual Studio's text editor.
- Right click on your project in Solution Explorer.
- Select Unload Project
- Right click on your (unloaded) project in Solution Explorer.
- Select Edit MyProject.csproj
- Find the DefineConstants elements and edit your defined symbols there directly. The settings for Debug and Release configurations are in separate PropertyGroup elements.
- Right click on your (unloaded) project in Solution Explorer.
- Select Reload Project
But i want to add all my #define
in one file and ask the project to refer to that file, in iOS we can achieve this by using prefix.pch file. can i do it in that way here for WP8
If yes how? if not apart from adding the #define to Conditional compilation symbols is there any other way that we can achieve this ?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow