I em working with wss3.0 and moss. I need to define a constant which is true for wss3.0 and false for moss. I am using the following method to detect whether my custom webpart is running under wss or moss.
public static bool IsMOSS()
SPFeatureDefinitionCollection features = SPContext.Current.Site.WebApplication.Farm.FeatureDefinitions;
if (features["OssNavigation"] != null && features["Publishing"] != null)
But how can I set the above result(true or false) to the csproj constants?is is possible? if not then how can I load the assembly(dll) based on wss or moss in the project?
Your code is executed at run-time. A constant is hard coded in the assembly. So it won't possible to create a constant on the fly (even semantically, it does not make sense).
As Moss is a superset of WSS, do you actually have to distinguish? In such cases, I would simply put all WSS compatible in a first project and its set of features, and all Moss-specific code in a second project.