Conditional compilation

Because C# doesn’t use define directives like other platforms you don’t get the same compile time options based on platform target etc. The simple solution is to set a “Conditional compilation symbol” as follows In Project properties > Build Select the platform you want to detect . In “Conditional compilation symbols”, add a new symbol […]

Read More

Project Files

Add a file from another project (so its shared between the projects) Add > Existing Item > Select the file(s) and then press the drop-down on the right of the “Add” button and select “Add as link”. Note this isn’t possible for adding files to a shared folder, the drop-down arrow won’t be shown (you […]

Read More

Rename project

Open the project and rename in the solution explorer Change output exe name Right click on project in Solution Explorer and select “Properties” from popup menu > “Application” change the “Assembly name”    

Read More

Change target .net framework version

Right click project in Solution Explorer window and choosing Unload Project. Right click project > Edit projectname.vcxproj Edit <TargetFrameworkVersion> to be the version you want to target Right click project > Reload project  

Read More

References

Add project references (e.g. .NET, COM etc plug ins) by right clicking References in Solution Explorer

Read More

Platform Target

A classic source of run problems in C# can be if your using components that are 32bit in an application with the Platform.  Setting the Platform Target to x86 will often solve this whilst still allowing the app to run on an x64 platform. Menu > Project > Project Properties > Build > Platform Target

Read More

Creating A Windows Forms Project From scratch

This is our internal check list to create a new Windows Forms Project… Create a ‘Visual C#’ > ‘Windows’ > ‘Windows Forms Application’. Once created:- Re-name the created form to frmMain.h by right clicking it in the solution explorer and selecting ‘Rename’  Click Yes to updating all references. Things To Add To The Default Form […]

Read More