Preprocessor directive in C# for importing based on platform

前端 未结 4 1946
别跟我提以往
别跟我提以往 2020-11-28 12:03

Looking for a preprocessor directive in c# for importing dll based on whether the executable is 64bit or 32 bit:

#if WIN64
[DllImport(\"ZLIB64.dll\", Calling         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 12:17

    You'll have to add a conditional compilation symbol for each target platform in your project's properties, in the Build tab. Simply add a symbol for the given Platform as determined by the Platform drop-down at the top of the Build form. Changing Platform will allow you do add different symbols that apply only to a build for that platform.

提交回复
热议问题