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

Error: System.ArgumentException: Identifier is not CLS-compliant. (Parameter 'ident') #110435

Open
theolivenbaum opened this issue Dec 5, 2024 · 0 comments
Labels
area-Serialization untriaged New issue has not been triaged by the area owner

Comments

@theolivenbaum
Copy link

Description

Cross-post from this bug, which is still active: dotnet/interactive#1881

Reproduction Steps

See: dotnet/interactive#1881

Expected behavior

XmlSerializer works on runtime-created assemblies

Actual behavior

Exception:

Error: System.ArgumentException: Identifier 'Submission#8' is not CLS-compliant. (Parameter 'ident')
at System.Xml.Serialization.CodeIdentifier.CheckValidIdentifier(String ident)
at System.Xml.Serialization.CodeIdentifier.EscapeKeywords(String identifier, StringBuilder sb)
at System.Xml.Serialization.CodeIdentifier.GetCSharpName(Type t, Type[] parameters, Int32 index, StringBuilder sb)
at System.Xml.Serialization.CodeIdentifier.GetCSharpName(Type t, Type[] parameters, Int32 index, StringBuilder sb)
at System.Xml.Serialization.CodeIdentifier.GetCSharpName(Type t)
at System.Xml.Serialization.TypeDesc.get_CSharpName()
at System.Xml.Serialization.SourceInfo.CastTo(TypeDesc td)
at System.Xml.Serialization.XmlSerializationWriterILGen.WriteElements(SourceInfo source, String enumSource, ElementAccessor[] elements, TextAccessor text, ChoiceIdentifierAccessor choice, String arrayName, Boolean writeAccessors, Boolean isNullable)
at System.Xml.Serialization.XmlSerializationWriterILGen.WriteMember(SourceInfo source, String choiceSource, ElementAccessor[] elements, TextAccessor text, ChoiceIdentifierAccessor choice, TypeDesc memberTypeDesc, Boolean writeAccessors)
at System.Xml.Serialization.XmlSerializationWriterILGen.GenerateTypeElement(XmlTypeMapping xmlTypeMapping)
at System.Xml.Serialization.XmlSerializationWriterILGen.GenerateElement(XmlMapping xmlMapping)
at System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at Submission#8.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Serialization untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant