CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.91k stars 549 forks source link

Exception: System.Exception: Native code encountered, plug required. #2773

Closed qveezzx closed 11 months ago

qveezzx commented 11 months ago

Have you checked Github Issues for similar errors? Yes, even repo which from i used source (~5 months ago, it was working), the repo dev didnt respond for 2 of my issues.

Exception Exception: System.Exception: Native code encountered, plug required. Check build output for more information. SphereOS C:\Users\Oliwier\Desktop\AUTORSKIE\OS\SphereOS\SphereOS\IL2CPU 1

Visual Studio Output Logs _Rozpoczęto kompilację... 1>------ Kompilacja rozpoczęta: Projekt: SphereOS, Konfiguracja: Debug Any CPU ------ 1>C:\Users\Oliwier\Desktop\AUTORSKIE\OS\SphereOS\SphereOS\SphereOS.csproj : warning NU1603: Element SphereOS zależy od elementu Cosmos.Build (>= 0.1.0-localbuild20230617112142), ale nie znaleziono elementu Cosmos.Build 0.1.0-localbuild20230617112142. Najlepsze rozpoznane przybliżone dopasowanie to Cosmos.Build 0.1.0-localbuild20230916025026. 1>SphereOS -> C:\Users\Oliwier\Desktop\AUTORSKIE\OS\SphereOS\SphereOS\bin\Debug\net6.0\SphereOS.dll 1>Executing IL2CPU on assembly 1>Kernel Base: Cosmos.System.Kernel 1>Checking target assembly: C:\Users\Oliwier\Desktop\AUTORSKIE\OS\SphereOS\SphereOS\bin\Debug\net6.0\SphereOS.dll 1>IL2CPU : error : Exception: System.Exception: Native code encountered, plug required. Check build output for more information. 1> DO NOT REPORT THIS AS A BUG. 1> Please see http://www.gocosmos.org/docs/plugs/missing/ 1> Need plug for: System.Void System.String..ctor(System.ReadOnlySpan1<System.Char>)(Plug Signature: System_Void__System_String__ctor_System_ReadOnlySpan_1_System_Char__ ). 1> Static: False 1> Assembly: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e 1> Called from: 1>System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::System.String ToStringAndClear() 1>Cosmos.System.Kernel::Void Start() 1> 1> 1> 1> at Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug, String sourceItem) in C:\Users\Oliwier\Desktop\AUTORSKIE\SphereOS-master\clone\SphereOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 562 1> at Cosmos.IL2CPU.ILScanner.ScanQueue() in C:\Users\Oliwier\Desktop\AUTORSKIE\SphereOS-master\clone\SphereOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 751 1> at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable1 plugsAssemblies) in C:\Users\Oliwier\Desktop\AUTORSKIE\SphereOS-master\clone\SphereOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 270 1> at Cosmos.IL2CPU.CompilerEngine.Execute() in C:\Users\Oliwier\Desktop\AUTORSKIE\SphereOS-master\clone\SphereOS\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 189 1>IL2CPU task took 00:00:00.3475992 1>Kompilowanie projektu „SphereOS.csproj” wykonane — NIEPOWODZENIE. ========== Kompilacja: sukces — 0, niepowodzenie (failed) — 1, aktualne — 0, pominięto — 0 ========== ========== upłynęło 00:00,636 =========_

How To Reproduce no changes i think, used https://github.com/LumaTechnologies/SphereOS

Screenshots image

Context Before posting please confirm that the following are in order [✅] Both Cosmos VS Extensions are installed [✅] In the NuGet Package Manager "Include prerelease" is selected [✅] The Cosmos NuGet package store is selected (NOT nuget.org) in 'Manage NuGet Packages' [✅] The Cosmos NuGet packages are installed

zarlo commented 11 months ago

looks like ``System.String..ctor(System.ReadOnlySpan1)``` needs a plug

okay it looks like its making an internal call but it should not be hard to plug

MishaTy commented 11 months ago

Can you please check if the Cosmos.Plugs nuget package is installed?

Arawn-Davies commented 11 months ago

Can confirm the issue isn't OS-specific, something has broken in a (recent?) commit. Projects which build in the userkit aren't building in the devkit for some reason.

My OS (Medli) for example:

>Kernel Base: Cosmos.System.Kernel
2>Checking target assembly: C:\Users\azama\Desktop\Medli\Medli_Boot\bin\Debug\net6.0\Medli_Boot.dll
2>IL2CPU : error : Exception: System.Exception: Native code encountered, plug required. Check build output for more information.
2>  DO NOT REPORT THIS AS A BUG.
2>  Please see http://www.gocosmos.org/docs/plugs/missing/
2>  Need plug for: System.Void  System.String..ctor(System.ReadOnlySpan`1<System.Char>)(Plug Signature: System_Void__System_String__ctor_System_ReadOnlySpan_1_System_Char__ ).
2>  Static: False
2>  Assembly: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2>  Called from:
2>System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::System.String ToStringAndClear()
2>Cosmos.System.Kernel::Void Start()
2>
2>
2>
2>   at Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug, String sourceItem) in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 562
2>   at Cosmos.IL2CPU.ILScanner.ScanQueue() in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 751
2>   at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable`1 plugsAssemblies) in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 270
2>   at Cosmos.IL2CPU.CompilerEngine.Execute() in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 189
2>IL2CPU task took 00:00:00.5564257
2>Done building project "Medli_Boot.csproj" -- FAILED.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 23:42 and took 01.169 seconds ==========

@valentinbreiz @geomtech I tested building Aura in latest devkit, same result:

>Kernel Base: Cosmos.System.Kernel
3>Checking target assembly: C:\Users\azama\Desktop\Aura-Operating-System\SRC\Aura_Boot\bin\Debug\net6.0\Aura_Boot.dll
3>IL2CPU : warning : Loading plugs from assembly: Aura_Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
3>IL2CPU : error : Exception: System.Exception: Native code encountered, plug required. Check build output for more information.
3>  DO NOT REPORT THIS AS A BUG.
3>  Please see http://www.gocosmos.org/docs/plugs/missing/
3>  Need plug for: System.Void  System.String..ctor(System.ReadOnlySpan`1<System.Char>)(Plug Signature: System_Void__System_String__ctor_System_ReadOnlySpan_1_System_Char__ ).
3>  Static: False
3>  Assembly: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  Called from:
3>System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::System.String ToStringAndClear()
3>Cosmos.System.Kernel::Void Start()
3>
3>
3>
3>   at Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug, String sourceItem) in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 562
3>   at Cosmos.IL2CPU.ILScanner.ScanQueue() in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 751
3>   at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable`1 plugsAssemblies) in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 270
3>   at Cosmos.IL2CPU.CompilerEngine.Execute() in C:\Users\azama\Desktop\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 189
3>IL2CPU task took 00:00:00.3870988
3>Done building project "Aura_Boot.csproj" -- FAILED.
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 23:40 and took 00.916 seconds ==========

Not sure what's happened :/

Arawn-Davies commented 11 months ago

A solution:

Add the following to your project's .csproj file

<PackageReference Include="Cosmos.Plugs" Version="0-*" NoWarn="NU1604" />
qveezzx commented 11 months ago

Thanks, the line i needed to add to .csproj helped me.

DarkOutcast6 commented 8 months ago

A solution:

Add the following to your project's .csproj file

<PackageReference Include="Cosmos.Plugs" Version="0-*" NoWarn="NU1604" />

@Arawn-Davies Having the same problem. Adding the line to my .csprog didn't do anything. EDIT: this line seems to work: <PackageReference Include="Cosmos.Plugs" Version="latest-stable-version" NoWarn="NU1604" />