Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compile using LA Portable Version
#1
I imported the HTTP server project into the LA portable version, and the following error occurred during compilation. The path mentioned in red below does not exist.


Failed to compile 'HTTP server.cs'. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Au.folders.get_NetRuntimeDesktop()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.PropertyInfo.GetValue(Object obj)
   at Au.folders.<>c.<.cctor>b__315_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
--- End of stack trace from previous location ---
   at System.Lazy`1.CreateValue()
   at Au.folders.unexpandPath(String path, String& folder, String& name)
   at Au.folders.unexpandPath(String path)
   at Au.Compiler.Compiler.XCompiled.AddCompiled(FileNode f, String outFile, MetaComments m, MPFlags miniFlags) in C:\code\au\Au.Editor\Compiler\XCompiled.cs:line 178
   at Au.Compiler.Compiler._Compile(CCReason reason, FileNode f, CompResults& r, FileNode projFolder, Action& aFinally, Func`2 canCompile, MCFlags addMetaFlags) in C:\code\au\Au.Editor\Compiler\Compiler.cs:line 298
   at Au.Compiler.Compiler.Compile(CCReason reason, CompResults& r, FileNode f, FileNode projFolder, Boolean needMeta, Func`2 canCompile, MCFlags addMetaFlags) in C:\code\au\Au.Editor\Compiler\Compiler.cs:line 58

Adding DLL reference doesn't work.
https://i.ibb.co/7rp2w9R/AAA.gif

In the LA portable version, sometimes the referenced path is added in the following format.
/*/ r data\doc\Main\dll\Newtonsoft.Json.dll; /*/

I think it should be added in this format.
/*/ r %dll%\Newtonsoft.Json.dll; /*/
#2
Thank you. Fixed in next LA.
#3
The following error has occurred again. I have tried many methods but have not resolved it. It is not possible to compile successfully on the portable version.

Failed to compile 'HTTP server.cs'. System.InvalidOperationException: Two different versions of file:
    C:\Users\Administrator\Desktop\LA\data\doc\Main\dll\Newtonsoft.Json.dll
    C:\Program Files\PowerShell\7\Newtonsoft.Json.dll
   at Au.Compiler.Compiler.<_GetDllPaths>g___Add|9_1(Dictionary`2& d, String s, String path, Boolean isDll, <>c__DisplayClass9_0&) in C:\code\au\Au.Editor\Compiler\Compiler.cs:line 586
   at Au.Compiler.Compiler._GetDllPaths() in C:\code\au\Au.Editor\Compiler\Compiler.cs:line 593
   at Au.Compiler.Compiler._Compile(CCReason reason, FileNode f, CompResults& r, FileNode projFolder, Action& aFinally, Func`2 canCompile, MCFlags addMetaFlags) in C:\code\au\Au.Editor\Compiler\Compiler.cs:line 256
   at Au.Compiler.Compiler.Compile(CCReason reason, CompResults& r, FileNode f, FileNode projFolder, Boolean needMeta, Func`2 canCompile, MCFlags addMetaFlags) in C:\code\au\Au.Editor\Compiler\Compiler.cs:line 58

not find C:\code\au\Au.Editor\Compiler\
#4
Two different versions of Newtonsoft.Json.dll are used by assemblies used in your script or project. If no error with non-portable LA, probably either one of the dlls does not exist or both dlls are identical (the same version).
#5
On the same computer, using the installed version of LA compiles successfully, but using the portable version of LA results in the above error.

Maybe I need to synchronize certain files to portable LA. This issue is expected to be resolved in the next version of LA.
#6
Probably C:\Users\Administrator\Desktop\LA\data\doc\Main\dll\Newtonsoft.Json.dll is a different version than Newtonsoft.Json.dll in non-portable.

Code:
Copy      Help
print.it(System.Reflection.Assembly.LoadFile(folders.Workspace + @"dll\Newtonsoft.Json.dll"));
#7
ver1.4,
It's a bit strange; the installed version compiles successfully, but the portable version does not.
#8
I am still stuck on this issue. On my several computers, the version numbers of .NET 8.0.X and PowerShell.SDK 7.0.X cannot be fully unified


Forum Jump:


Users browsing this thread: 1 Guest(s)