Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET8.0 XML Exception Problem #142

Open
SwEngine opened this issue Apr 18, 2024 · 16 comments
Open

.NET8.0 XML Exception Problem #142

SwEngine opened this issue Apr 18, 2024 · 16 comments

Comments

@SwEngine
Copy link

I was using the package in .net7.0 without problems. However, after updating to .net8.0, my program throws error. When I unchecked the trimming unused code option, there was no error, but it increases output file size very much. How can I solve it?

@FreeAndNil
Copy link
Contributor

FreeAndNil commented Apr 18, 2024

Hi @SwEngine,

can you please be more specific?
What exact error do you get when you do what?

@SwEngine
Copy link
Author

SwEngine commented Apr 18, 2024

I use only normal logging processes. When releasing the executable, I checked the trimming unused code option, it gives the error below,
However, when I unchecked the trimming unused code option, it does not give any error.

log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
 ---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
   at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
   at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
   at System.Configuration.ClientConfigurationSystem..ctor()
   at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
 ---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
   at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
   at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
   at System.Configuration.ClientConfigurationSystem..ctor()
   at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
 ---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
   at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
   at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
   at System.Configuration.ClientConfigurationSystem..ctor()
   at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
 ---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
   at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
   at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
   at System.Configuration.ClientConfigurationSystem..ctor()
   at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
 ---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
   at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
   at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
   at System.Configuration.ClientConfigurationSystem..ctor()
   at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
 ---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
   at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
   at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
   at System.Configuration.ClientConfigurationSystem..ctor()
   at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at log4net.Util.SystemInfo.GetAppSetting(String)
Program::Run msg=The type initializer for 'log4net.Core.LoggerManager' threw an exception.
Unhandled exception. System.TypeInitializationException: The type initializer for 'log4net.Core.LoggerManager' threw an exception.
 ---> System.ArgumentOutOfRangeException: Parameter: defaultRepositoryType, Value: [log4net.Repository.Hierarchy.Hierarchy] out of range. Argument must implement the ILoggerRepository interface (Parameter 'defaultRepositoryType')
Actual value was log4net.Repository.Hierarchy.Hierarchy.
   at log4net.Core.DefaultRepositorySelector..ctor(Type)
   at log4net.Core.LoggerManager..cctor()
   --- End of inner exception stack trace ---
   at log4net.Core.LoggerManager.OnProcessExit(Object sender, EventArgs e)
   at System.AppContext.OnProcessExit()

@FreeAndNil
Copy link
Contributor

FreeAndNil commented Apr 18, 2024

@SwEngine thanks for the info. Can you check whether the change in #143 works for you?

@SwEngine
Copy link
Author

I could not build your code :( could you share a dll file? Sorry for inconvenience

@FreeAndNil
Copy link
Contributor

@SwEngine
Copy link
Author

SwEngine commented Apr 18, 2024

I am adding your dll file to my project from project references, however

logger = LogManager.GetLogger(typeof(Logger));

this line gives error of:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0012	The type 'Assembly' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.	Logger	C:\Users\Desktop\Logger\Logger\Logger.cs	15	N/A

@FreeAndNil
Copy link
Contributor

Can you put a simple repro somewhere on Github?

@FreeAndNil
Copy link
Contributor

@SwEngine maybe posting your csproj file could also help

@FreeAndNil
Copy link
Contributor

@SwEngine is this still relevant for you?
Otherwise I will close this at the end of the week.

@SwEngine
Copy link
Author

I am on vacation, but next week I will look at again, thank you so much!

@FreeAndNil FreeAndNil mentioned this issue May 9, 2024
@FreeAndNil
Copy link
Contributor

@SwEngine could you take a look?

@FreeAndNil
Copy link
Contributor

@SwEngine please reopen when you have feedback

@szogun1987
Copy link

szogun1987 commented Aug 28, 2024

I have the same error in relatively simple project.
Error does not occur on dev environment.
Error occurs in the docker image.
I use Microsoft.Extensions.Logging.Log4Net.AspNetCore to integrate log4net and my app. It handles only log4net.config so it can be a problem.
I prefer not to keep project private (I'm not sure if repo contains some auth data) but I can share it with 1 or 2 persons (on Gitlab)

Edit:
Here is a link to the same issue in integration library: huorswords/Microsoft.Extensions.Logging.Log4Net.AspNetCore#138

@szogun1987
Copy link

I have also build log:

/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Mvc' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.extensions.logging.log4net.aspnetcore/8.0.0/lib/net8.0/Microsoft.Extensions.Logging.Log4Net.AspNetCore.dll : warning IL2104: Assembly 'Microsoft.Extensions.Logging.Log4Net.AspNetCore' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/log4net/2.0.15/lib/netstandard2.0/log4net.dll : warning IL3053: Assembly 'log4net' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.ViewFeatures.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/log4net/2.0.15/lib/netstandard2.0/log4net.dll : warning IL2104: Assembly 'log4net' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
ILC : warning IL3000: log4net.Util.SystemInfo.EntryAssemblyLocation.get: 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.Core.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Mvc.Core' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Components.Endpoints.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Components.Endpoints' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Components.Endpoints.dll : warning IL3053: Assembly 'Microsoft.AspNetCore.Components.Endpoints' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
ILC : warning IL3000: log4net.Util.SystemInfo.AssemblyLocationInfo(Assembly): 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Components.dll : warning IL3053: Assembly 'Microsoft.AspNetCore.Components' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/system.configuration.configurationmanager/4.5.0/lib/netstandard2.0/System.Configuration.ConfigurationManager.dll : warning IL2104: Assembly 'System.Configuration.ConfigurationManager' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
ILC : warning IL3000: Microsoft.AspNetCore.Mvc.ApplicationParts.RelatedAssemblyAttribute.GetRelatedAssemblies(Assembly,Boolean,Func`2<String,Boolean>,RelatedAssemblyAttribute.AssemblyLoadContextWrapper): 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
ILC : warning IL3000: Microsoft.AspNetCore.Mvc.ApplicationParts.RelatedAssemblyAttribute.GetRelatedAssemblies(Assembly,Boolean,Func`2<String,Boolean>,RelatedAssemblyAttribute.AssemblyLoadContextWrapper): 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.Core.dll : warning IL3053: Assembly 'Microsoft.AspNetCore.Mvc.Core' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.RazorPages.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Mvc.RazorPages' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/newtonsoft.json/13.0.1/lib/netstandard2.0/Newtonsoft.Json.dll : warning IL2104: Assembly 'Newtonsoft.Json' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.Abstractions.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Mvc.Abstractions' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.ViewFeatures.dll : warning IL3053: Assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.Abstractions.dll : warning IL3053: Assembly 'Microsoft.AspNetCore.Mvc.Abstractions' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/newtonsoft.json/13.0.1/lib/netstandard2.0/Newtonsoft.Json.dll : warning IL3053: Assembly 'Newtonsoft.Json' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
ILC : warning IL3002: System.Configuration.ClientConfigPaths.ClientConfigPaths(String,Boolean): Using member 'System.Reflection.Module.Name.get' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app. Returns <Unknown> for modules with no file path. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
ILC : warning IL3002: System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(String): Using member 'System.Reflection.Module.Name.get' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app. Returns <Unknown> for modules with no file path. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.Razor.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Mvc.Razor' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.Razor.dll : warning IL3053: Assembly 'Microsoft.AspNetCore.Mvc.Razor' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.RazorPages.dll : warning IL3053: Assembly 'Microsoft.AspNetCore.Mvc.RazorPages' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Mvc.DataAnnotations.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Mvc.DataAnnotations' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.8/framework/System.Linq.Expressions.dll : warning IL3053: Assembly 'System.Linq.Expressions' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs(6722): Trim analysis warning IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataTable.WriteXmlInternal(XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.WriteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataSet.cs(3529): Trim analysis warning IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataSet.WriteXmlInternal(XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.WriteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.8/framework/Microsoft.CSharp.dll : warning IL3053: Assembly 'Microsoft.CSharp' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.8/runtimes/linux-x64/lib/net8.0/Microsoft.AspNetCore.Components.dll : warning IL2104: Assembly 'Microsoft.AspNetCore.Components' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/root/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.8/framework/System.Private.Xml.dll : warning IL3053: Assembly 'System.Private.Xml' produced AOT analysis warnings. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs(6704): Trim analysis warning IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataTable.ReadXmlSerializableInternal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataSet.cs(3507): Trim analysis warning IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataSet.ReadXmlSerializableInternal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs(6668): Trim analysis warning IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataTable.GetXmlSchema()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.GetSchema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimmed if not referenced directly. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataSet.cs(3473): Trim analysis warning IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataSet.WriteXmlSchema(DataSet,XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.GetSchema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimmed if not referenced directly. [/opt/atlassian/pipelines/agent/build/src/SzogunUI.Skupomat.Auth.Web/SzogunUI.Skupomat.Auth.Web.csproj]

@FreeAndNil
Copy link
Contributor

@szogun1987 can you create a minimal sample project reproducing the problem?

@szogun1987
Copy link

ApacheLog4NetSample.zip
Just open WebApplication1 folder and run

docker build -t web-app:0.0.1-local .
docker run -it --rm web-app:0.0.1-local

in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants