Hi. Is there any way to set api compatibility level to .Net 4.x when using build configurations?
We use GameLift SDK which by default requires .Net 4.x. Our project also uses DOTS, so we have to use build configurations according to documentation. It seems that builds made this way have api copmatibility level set to .Net 2.0 by default, so I’m getting errors at runtime from GameLift dll’s. I could reproduce same error with old build routine (File->BuildSettings->Build) if api compatibility level is set to .Net 2.0
Fortunately, old build routine works for us for now, so we still can make builds for linux game server
The Api Compatibility Level should only impact the .NET API surface available at compile time. It has no impact on the .NET base class library used at run time, so I don’t think it will have an impact on this behavior. But can you share the errors you see at run time? Maybe that will help us understand their cause.
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.PlatformNotSupportedException: Operation is not supported on this platform.
at log4net.Util.SystemInfo.GetAppSetting (System.String key) [0x00002] in <9ea670cdbf41450aa8beb1f63c6429db>:0
If I’m understanding this correctly, log4net is trying to identify actual platform settings, which are not valid in my case for some reason.
I guess I’ll have to dig into log4net source code. Exception is thrown from the following function, by the way
/// <summary>Lookup an application setting</summary>
/// <param name="key">the application settings key to lookup</param>
/// <returns>the value for the key, or <c>null</c></returns>
/// <remarks>
/// <para>
/// Configuration APIs are not supported under the Compact Framework
/// </para>
/// </remarks>
public static string GetAppSetting(string key)
{
try
{
return ConfigurationManager.AppSettings[key];
}
catch (Exception ex)
{
LogLog.Error(SystemInfo.declaringType, "Exception while reading ConfigurationSettings. Check your .config file is well formed XML.", ex);
}
return (string) null;
}