Log4netAssemblyInfo.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #region Apache License
  2. //
  3. // Licensed to the Apache Software Foundation (ASF) under one or more
  4. // contributor license agreements. See the NOTICE file distributed with
  5. // this work for additional information regarding copyright ownership.
  6. // The ASF licenses this file to you under the Apache License, Version 2.0
  7. // (the "License"); you may not use this file except in compliance with
  8. // the License. You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. //
  18. #endregion
  19. namespace log4net {
  20. /// <summary>
  21. /// Provides information about the environment the assembly has
  22. /// been built for.
  23. /// </summary>
  24. public sealed class AssemblyInfo {
  25. /// <summary>Version of the assembly</summary>
  26. public const string Version = "2.0.8";
  27. /// <summary>Version of the framework targeted</summary>
  28. #if NET_1_1
  29. public const decimal TargetFrameworkVersion = 1.1M;
  30. #elif NET_4_5
  31. public const decimal TargetFrameworkVersion = 4.5M;
  32. #elif NET_4_0 || MONO_4_0
  33. public const decimal TargetFrameworkVersion = 4.5M;
  34. #elif FRAMEWORK_4_0_OR_ABOVE
  35. public const decimal TargetFrameworkVersion = 4.0M;
  36. #elif MONO_3_5
  37. public const decimal TargetFrameworkVersion = 3.5M;
  38. #elif NET_2_0 || NETCF_2_0 || MONO_2_0
  39. #if !CLIENT_PROFILE
  40. public const decimal TargetFrameworkVersion = 2.0M;
  41. #else
  42. public const decimal TargetFrameworkVersion = 3.5M;
  43. #endif // Client Profile
  44. #else
  45. public const decimal TargetFrameworkVersion = 1.0M;
  46. #endif
  47. /// <summary>Type of framework targeted</summary>
  48. #if CLI
  49. public const string TargetFramework = "CLI Compatible Frameworks";
  50. #elif NET
  51. public const string TargetFramework = ".NET Framework";
  52. #elif NETCF
  53. public const string TargetFramework = ".NET Compact Framework";
  54. #elif MONO
  55. public const string TargetFramework = "Mono";
  56. #elif SSCLI
  57. public const string TargetFramework = "Shared Source CLI";
  58. #elif NETSTANDARD1_3
  59. public const string TargetFramework = ".NET Core";
  60. #else
  61. public const string TargetFramework = "Unknown";
  62. #endif
  63. /// <summary>Does it target a client profile?</summary>
  64. #if !CLIENT_PROFILE
  65. public const bool ClientProfile = false;
  66. #else
  67. public const bool ClientProfile = true;
  68. #endif
  69. /// <summary>
  70. /// Identifies the version and target for this assembly.
  71. /// </summary>
  72. public static string Info {
  73. get {
  74. return string.Format("Apache log4net version {0} compiled for {1}{2} {3}",
  75. Version, TargetFramework,
  76. /* Can't use
  77. ClientProfile && true ? " Client Profile" :
  78. or the compiler whines about unreachable expressions
  79. */
  80. #if !CLIENT_PROFILE
  81. string.Empty,
  82. #else
  83. " Client Profile",
  84. #endif
  85. TargetFrameworkVersion);
  86. }
  87. }
  88. }
  89. }