multi targeting in command line compiler (csc.exe)

前端 未结 2 1830
旧时难觅i
旧时难觅i 2021-01-24 12:19

My question is simple: How can I do multi-targeting in command line compiler (csc.exe), especially to .Net 4 Client Profile?


edit: Ok, Is my que

2条回答
  •  悲哀的现实
    2021-01-24 13:03

    TargetFramework can be configured in the Project file only and can't be passed as a switch to CSC.exe, see settings for TargetFrameworkVersion and TargetFrameworkProfile in below example

    So the only way to dynamically set is to modify the project file with below setting and compile with csc.exe if you want to set Client Profile

    Targetting .NET Framework 4.0 Client Profile

    
        Debug
        AnyCPU
        {A5F58561-47CA-482A-83E0-1D43C312B0A7}
        Exe
        Properties
        ConsoleApplication1
        ConsoleApplication1
        v4.0
        512
        Client
      
    

    Targetting .NET Framework 4.0

    
        Debug
        AnyCPU
        {A5F58561-47CA-482A-83E0-1D43C312B0A7}
        Exe
        Properties
        ConsoleApplication1
        ConsoleApplication1
        v4.0
        512
        
      
    

提交回复
热议问题