Click here to Skip to main content
15,922,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB.NET has a variable some place called _MyType that indicates the application type. One of them is "WindowsForm".

So, in the DLL vb says:
#If _MyType = "WindowsForm" then
...
#endif

How do I determine if this dll is being called by a WinApp or WebApp or ConsoleApp in C#?

Sorry I asked the wrong question before.
Posted

1 solution

I don't think VB.NET has a predefined symbol called _MyType. The projects you are using, or perhaps a 3rd party source library, may have done that through their project settings.

To simulate that in C# you will manually have to do the same. Define WindowsForms in all your Winforms projects, Console in all your console projects, WebApp in all your web projects, etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900