question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In Cosmos I received this error saying: Exception: System.Exception: Method GetMBIAddress requires a plug, but none is implemented

See original GitHub issue

Here is my most recent build log:

1>------ Build started: Project: CosmosBitmapTest, Configuration: Debug Any CPU ------ 1>CosmosBitmapTest -> C:\Users\elkaa\source\repos\CosmosBitmapTest\CosmosBitmapTest\bin\Debug\netcoreapp2.0\cosmos\CosmosBitmapTest.dll 1>Message: Executing IL2CPU on assembly 1>Message: Kernel Base: Cosmos.System.Kernel 1>Message: Checking target assembly: C:\Users\elkaa\source\repos\CosmosBitmapTest\CosmosBitmapTest\bin\Debug\netcoreapp2.0\cosmos\CosmosBitmapTest.dll 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.FIELD_INFO’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.FIELD_MAPPING’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.AssemblyFile’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.Document’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.Method’ 1>IL2CPU : error : Exception: System.Exception: Method GetMBIAddress requires a plug, but none is implemented 1> at Cosmos.IL2CPU.ILScanner.Assemble() in C:\Development\Cosmos\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 988 1> at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable`1 plugsAssemblies) in C:\Development\Cosmos\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 266 1> at Cosmos.IL2CPU.CompilerEngine.Execute() in C:\Development\Cosmos\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 200 1>IL2CPU task took 00:00:36.9745550 1>Done building project “CosmosBitmapTest.csproj” – FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I was trying to display a bitmap onto the screen using this example https://github.com/CosmosOS/Cosmos/issues/1434 Here is the source code:

`using Cosmos.Core; using Cosmos.System.FileSystem; using Cosmos.System.FileSystem.VFS; using Cosmos.System.Graphics; using System; using System.Drawing; using Sys = Cosmos.System;

namespace CosmosKernel1 { public class Kernel : Sys.Kernel { Canvas canvas; Bitmap wallpaper;

    protected override void BeforeRun()
    {
        CosmosVFS cosmosVFS = new CosmosVFS();
        VFSManager.RegisterVFS(cosmosVFS);

        wallpaper = new Bitmap(@"0:\wallpaper.bmp");

        canvas = FullScreenCanvas.GetFullScreenCanvas();
        canvas.Mode = new Mode(640, 480, ColorDepth.ColorDepth32);
    }

    protected override void Run()
    {
        string s = Console.ReadLine();
        Console.WriteLine(s);

        canvas.Clear();
        canvas.DrawImage(wallpaper, 0, 0);
        //canvas.DrawString($"Installed RAM:{CPU.GetAmountOfRAM()}MB", new Pen(Color.White), 10, 10);
        canvas.DrawFilledRectangle(new Pen(Color.FromArgb(199, 199, 199)), 0, 440, 640, 40);
        canvas.DrawFilledRectangle(new Pen(Color.White), 0, 442, 640, 1);

        canvas.DrawLine(new Pen(Color.FromArgb(135, 135, 135)), 560, 448, 634, 448);
        canvas.DrawLine(new Pen(Color.FromArgb(135, 135, 135)), 560, 448, 560, 474);

        canvas.DrawLine(new Pen(Color.FromArgb(255, 255, 255)), 560, 474, 634, 474);
        canvas.DrawLine(new Pen(Color.FromArgb(255, 255, 255)), 634, 448, 634, 474 + 1);

        Console.ReadKey();
    }
}

}`

When I tried to build/compile it I receive an error saying “The system cannot find the file specified”

P.S : What directory or folder do I put the bitmap that i’m using do I put it on my physical PC or my virtual OS ? Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:43 (40 by maintainers)

github_iconTop GitHub Comments

2reactions
EliaSulimanovcommented, Aug 20, 2020

By this line of yours: wallpaper = new Bitmap(Encoding.Default.GetString(text_to_read)); I see you are tring to pass the file context to the Bitmap constructor, but the ctor of Bitmap that takes string expecting path. Probably this is why you are getting illegal characters exception, apart from the corruption comes afterwards.

0reactions
elkaamee326commented, Aug 20, 2020

Thank you so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when building project: Could not load type 'Cosmos. ...
Now I am getting this error: Exception: System.Exception: Method GetMBIAddress requires a plug, but none is implemented testOS 1 ...
Read more >
Azure CosmosDB UpsertItemAsync error - Microsoft Q&A
System.Net.Http.HttpRequestException: An attempt was made to access a socket in a way forbidden by its access permissions.
Read more >
'Microsoft.Azure.Cosmos.CosmosException', Bad Request ...
1 console application. I'm successfully able to create the database and the container. However I'm getting the following error at Line 40 and...
Read more >
CosmosException (Azure SDK for Java Reference ...
This class defines a custom exception type for all operations on CosmosClient in the Azure Cosmos DB database service. Applications are expected to...
Read more >
Class NotFoundException
public class NotFoundException extends CosmosClientException. While this class is public, but it is not part of our published public APIs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found