Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Temporary exception when compiling with specific rules in rd.xml #6745

Closed
CoolOppo opened this issue Dec 30, 2018 · 1 comment
Closed

Temporary exception when compiling with specific rules in rd.xml #6745

CoolOppo opened this issue Dec 30, 2018 · 1 comment

Comments

@CoolOppo
Copy link

Hi. Appreciate the help. I was running into a missing metadata error that said the following, when trying to deserialize xml (only came up after adding <IlcArg Include="--completetypemetadata" /> to my .csproj):

MakeGenericMethod() cannot create this generic method instantiation because the instantiation was not metadata-enabled: 'System.Xml.Serialization.ReflectionXmlSerializationReaderHelper.GetSetMemberValueDelegateWithType<MakeUltra.Rule,System.String>(System.Reflection.MemberInfo)'

So I added the following to my rd.xml file, as seen in #4775:

		<Assembly Name="System.Private.Xml">
			<Type Name="System.Xml.Serialization.ReflectionXmlSerializationReaderHelper">
				<Method Name="GetSetMemberValueDelegateWithType" Dynamic="Required All">
					<GenericArgument Name="MakeUltra.Rule,System.String" />
				</Method>
			</Type>
		</Assembly>

Now when compiling, I get the following output:

EXEC : error : [TEMPORARY EXCEPTION MESSAGE] FileLoadErrorGeneric: System.String [C:\Users\Max\Desktop\deps native\MakeUltra\MakeUltra.csproj]
  Internal.TypeSystem.TypeSystemException+FileNotFoundException: [TEMPORARY EXCEPTION MESSAGE] FileLoadErrorGeneric: System.String
     at Internal.TypeSystem.ThrowHelper.ThrowFileNotFoundException(ExceptionStringID id, String fileName)
     at ILCompiler.CompilerTypeSystemContext.GetModuleForSimpleName(String simpleName, Boolean throwIfNotFound)
     at Internal.TypeSystem.CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeName(ModuleDesc module, String name, Boolean throwIfNotFound, Func`4 resolver)
     at ILCompiler.RdXmlRootProvider.ProcessMethodDirective(IRootingServiceProvider rootProvider, ModuleDesc containingModule, TypeDesc containingType, XElement methodElement)
     at ILCompiler.RdXmlRootProvider.ProcessTypeDirective(IRootingServiceProvider rootProvider, ModuleDesc containingModule, XElement typeElement)
     at ILCompiler.RdXmlRootProvider.ProcessAssemblyDirective(IRootingServiceProvider rootProvider, XElement assemblyElement)
     at ILCompiler.RdXmlRootProvider.AddCompilationRoots(IRootingServiceProvider rootProvider)
     at ILCompiler.Compilation..ctor(DependencyAnalyzerBase`1 dependencyGraph, NodeFactory nodeFactory, IEnumerable`1 compilationRoots, ILProvider ilProvider, DebugInformationProvider debugInformationProvider, DevirtualizationManager devirtualizationManager, Logger logger)
     at ILCompiler.ILScannerBuilder.ToILScanner()
     at ILCompiler.Program.Run(String[] args)
     at ILCompiler.Program.Main(String[] args)
C:\Users\Max\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-27229-01\build\Microsoft.NETCore.Native.targets(228,5): error MSB3073: The command ""C:\Users\Max\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-27229-01\tools\ilc" @"obj\Release\netcoreapp2.2\win-x64\native\MakeUltra.ilc.rsp"" exited with code 1. [C:\Users\Max\Desktop\deps native\MakeUltra\MakeUltra.csproj]

I think it must be because System.Private.Xml isn't available to me, but how do I resolve this otherwise?

I'm going to also tag #6477 and @MichalStrehovsky, seems relevant ;)

@CoolOppo
Copy link
Author

CoolOppo commented Dec 30, 2018

I fixed it by switching to Newtonsoft.JSON. I originally was only using XML because I couldn't get Newtonsoft.JSON to work (same exact issue as #6394). I posted my solution there. I'm going to mark this issue as closed because I think it might be solved with a similar fix I used over there, but feel free to reopen it if you want to. I am not going to work through it though because I only used XML since I thought it would be easier than JSON.

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

No branches or pull requests

1 participant