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

How to Solve This (Value cannot be null. Parameter name: property) #8065

Closed
Shadow4walker opened this issue Mar 29, 2020 · 4 comments
Closed

Comments

@Shadow4walker
Copy link

Shadow4walker commented Mar 29, 2020

I'm trying To Compile a test App With https://github.com/quartznet/quartznet
after Compiling when try to run the Compiled app I got below exception! idk What should i put in the rd.xml to make it run successfully! :/

Unhandled Exception: System.TypeInitializationException: A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
---> System.ArgumentNullException: Value cannot be null. Parameter name: property
at System.Linq.Expressions.Expression.Property(Expression, PropertyInfo) + 0x181
at TestApp!+0x12868b5
at TestApp!+0x1286712
at TestApp!+0x15003cd
at TestApp!+0x305d41
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
at TestApp!+0x88027a
at TestApp!+0x8ff08e
at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[]) + 0x82
at TestApp!+0xf10363
at Quartz.Logging.LogProvider.GetLogger(String) + 0x14
at TestApp!+0x7cbe74
at TestApp!+0xd69a93
--- End of inner exception stack trace ---
at TestApp!+0xd69a8a
at TestApp!+0xd6995d
at Quartz.Impl.StdSchedulerFactory.get_Log() + 0x9
at Quartz.Impl.StdSchedulerFactory.Initialize() + 0x2b4
at Quartz.Impl.StdSchedulerFactory.d__69.MoveNext() + 0x5f
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
at TestApp!+0xd6b0ca
at TestApp!+0xd6b004
at TestApp.Models.SchedulerManager.d__4.MoveNext() + 0xd4

the rd.Xml for this Lib Defined as Below

<Assembly Name="Quartz" Dynamic="Required All">
<Type Name="Quartz.Impl.StdSchedulerFactory" Dynamic="Required All"/>
<Type Name="Quartz.Simpl.RAMJobStore" Dynamic="Required All"/>
<Type Name="Quartz.Simpl.TaskSchedulingThreadPool" Dynamic="Required All"/>
<Type Name="Quartz.Core.QuartzScheduler" Dynamic="Required All"/>
<Type Name="Quartz.Core.QuartzSchedulerThread" Dynamic="Required All"/>
<Type Name="Quartz.Core.ErrorLogger" Dynamic="Required All"/>
<Type Name="Quartz.Core.SchedulerSignalerImpl" Dynamic="Required All"/>
</Assembly>

and when using <IlcArg Include="--stacktracedata" />

Unhandled Exception: System.TypeInitializationException: A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
---> System.ArgumentNullException: Value cannot be null. Parameter name: property
at System.Linq.Expressions.Expression.Property(Expression, PropertyInfo) + 0x181
at System.Runtime.CompilerServices.CallSiteBinder.Stitch[T](Expression, CallSiteBinder.LambdaSignature1) + 0x115 at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite1, Object[]) + 0x92
at TestApp!+0x150055d
at System.InvokeUtils.CallDynamicInvokeMethod(Object, IntPtr, Object, IntPtr, IntPtr, Object, Object[], BinderBundle, Boolean, Boolean, Boolean) + 0x211
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
at System.Linq.Expressions.Interpreter.MethodInfoCallInstruction.Run(InterpretedFrame) + 0x17a
at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame) + 0x2e
at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[]) + 0x82
at TestApp!+0xf104f3
at Quartz.Logging.LogProvider.GetLogger(String) + 0x14
at Quartz.Impl.StdSchedulerFactory..cctor() + 0x34
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xd3
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xca
at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnGCStaticBase(StaticClassConstructionContext*, Object) + 0xd
at Quartz.Impl.StdSchedulerFactory.get_Log() + 0x9
at Quartz.Impl.StdSchedulerFactory.Initialize() + 0x2b4
at Quartz.Impl.StdSchedulerFactory.d__69.MoveNext() + 0x5f
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xba
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x44
at TestApp.Models.SchedulerManager.d__4.MoveNext() + 0x102

any help to get ride of this please!

@MichalStrehovsky
Copy link
Member

and when using <IlcArg Include="--stacktracedata" />

How does your CSPROJ look like? The stack trace data should be enabled by default unless it was explicitly disabled. Did you turn off any compilation options?

@Shadow4walker
Copy link
Author

Shadow4walker commented Apr 1, 2020

and when using <IlcArg Include="--stacktracedata" />

How does your CSPROJ look like? The stack trace data should be enabled by default unless it was explicitly disabled. Did you turn off any compilation options?

thanks to @wieslawsoltes I'm using it like so

<!-- https://github.com/dotnet/corert --> <ItemGroup Condition="'$(CoreRT)' == 'True'"> <RdXmlFile Include="rd.xml" /> <!--Include stack trace data --> <IlcArg Include="--stacktracedata" /> <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" /> </ItemGroup>

and Compiling using .bat with
dotnet publish TestApp/TestApp.csproj -r win-x64 -c Release -f netcoreapp3.1 -p:CoreRT=True -o Native

@MichalStrehovsky
Copy link
Member

Can you paste the contents of the *.ilc.rsp file from obj\Release\netcoreapp3.1\win-x64\native? There should be a directory with that name in your project directory.

@Shadow4walker
Copy link
Author

Can you paste the contents of the *.ilc.rsp file from obj\Release\netcoreapp3.1\win-x64\native? There should be a directory with that name in your project directory.

sorry I have given up on this and removed the Project

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

2 participants