dotnet new strips our conditional compile code
See original GitHub issueI have an AppDelegate.cs
file in my project with the following code. It is being stripped out when dotnet new
is executed. I have verified the code is present in my packed NuGet.
#if DEBUG
Comet.Reload.Init();
#if
Is there a way to escape this and protect it?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
How can I conditionally compile my C# for Mono vs. ...
It seems to me that if you need to have Mono vs MS.NET differences, then you need to be making those decisions at...
Read more >Visual Studio: Use Conditional Compilation to Control ...
I have heard it said that the use of conditional compilation is often a strong code “smell” indicating a potential area for redesign....
Read more >Conditional Compilation - Elements Docs
Conditional compilation is applied based on the presence or lack of presence of named conditional defines. Defines are identifers that live in a...
Read more >Conditional compilation for ignoring method calls with the ...
In this post I describe conditional compilation using. ... NET Framework, your library uses one code path, and when you compile for ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Where is this documented? I looked for similar with no luck.
Yes @davidortinau you’ll need to escape it in your AppDelegate like the following:
Keep in mind that all of your conditional properties and groups in the csproj will also be stripped out if you do not escape them.