Get Assembly name at compile time in Visual Studio

后端 未结 5 1005
灰色年华
灰色年华 2021-01-15 06:40

Is there a way to find out the assembly name at design-time (i.e. not using reflection or runtime APIs such as System.Reflection.Assembly.GetEntryAssembly) from within Visua

5条回答
  •  [愿得一人]
    2021-01-15 06:55

    The "API" you could use is LINQ to XML after all the .csproj file is just xml. (and you can get the location of the .csproj file if you need from the solution file which for some reason is not XML but can be easily parsed)

提交回复
热议问题