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

It Could find the resource .bmp file while Compiling, but it exist in Solution Explorer and Windows File Explorer. #2890

Closed alessiob07 closed 7 months ago

alessiob07 commented 7 months ago

Have you checked Github Issues for similar errors? Yes

Exception Post the exception returned by Visual Studio Exception: System.Exception: Resource 'aleOS.Res.CursorStdWhite.bmp' not found!

Visual Studio Output Logs Post the entire output log given by Visual Studio for the build Build started at 21:28... 1>------ Build started: Project: aleOS, Configuration: Debug Any CPU ------ 1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers. 1>E:\Dev\aleOS\aleOS\Hardware\aMouse.cs(28,104,28,120): warning CS0649: Field 'aMouse.BcursorClickSkin' is never assigned to, and will always have its default value null 1>E:\Dev\aleOS\aleOS\Hardware\aMouse.cs(31,103,31,118): warning CS0649: Field 'aMouse.BcursorFuckSkin' is never assigned to, and will always have its default value null 1>E:\Dev\aleOS\aleOS\Hardware\aMouse.cs(25,102,25,116): warning CS0649: Field 'aMouse.BcursorStdSkin' is never assigned to, and will always have its default value null 1>aleOS -> E:\Dev\aleOS\aleOS\bin\Debug\net6.0\aleOS.dll 1>Executing IL2CPU on assembly 1>Kernel Base: Cosmos.System.Kernel 1>Checking target assembly: E:\Dev\aleOS\aleOS\bin\Debug\net6.0\aleOS.dll 1>IL2CPU : warning : Loading plugs from assembly: Cosmos.Core_Asm, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983 1>IL2CPU : warning : Loading plugs from assembly: Cosmos.Core_Plugs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983 1>IL2CPU : warning : Loading plugs from assembly: Cosmos.Debug.Kernel.Plugs.Asm, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983 1>IL2CPU : warning : Loading plugs from assembly: Cosmos.System2_Plugs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983 1>IL2CPU : warning : Invalid plug method! Target method not found. : A0SystemInt64A2CosmosSystem_PlugsSystemIOOSFileStreamStrategyImplSeekA0SystemInt64A0SystemObject 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.MethodIlOp' 1>IL2CPU : error : Exception: System.Exception: Resource 'aleOS.Res.CursorStdWhite.bmp' not found! 1> at Cosmos.IL2CPU.AppAssembler.ProcessField(FieldInfo aField) in E:\Downloads\Cosmos-main\IL2CPU\source\Cosmos.IL2CPU\AppAssembler.cs:line 1145 1> at Cosmos.IL2CPU.ILScanner.Assemble() in E:\Downloads\Cosmos-main\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 985 1> at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable'1 plugsAssemblies) in E:\Downloads\Cosmos-main\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 272 1> at Cosmos.IL2CPU.CompilerEngine.Execute() in E:\Downloads\Cosmos-main\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 186 1>IL2CPU task took 00:00:04.3532912 1>Done building project "aleOS.csproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Build completed at 21:28 and took 05.112 seconds ==========

How To Reproduce Describe any changes done to a clean kernel for this error to occur. On a new Class, I wrote this: internal class aMouse { //Init cursors [ManifestResourceStream(ResourceName = "aleOS.Res.CursorStdWhite.bmp")] public static byte[] BcursorStdSkin; public static Bitmap cursorStdSkin = new(BcursorStdSkin); ...

Screenshots If applicable, add screenshots to help explain your problem. image 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 YES, are they ok.

Add any other context about the problem which might be helpful.

I watched some tutorials and read code of others that used that and seems equal the path (projectName.Folder.Filename) so idk why it couldn't find it.

ascpixi commented 7 months ago

Have you set the "Build Action" property of the file to "Embedded Resource"?

alessiob07 commented 7 months ago

Oh, no, how should I?

Il ven 12 gen 2024, 00:49 ascpixi @.***> ha scritto:

Have you set the "Build Action" property of the file to "Embedded Resource"?

— Reply to this email directly, view it on GitHub https://github.com/CosmosOS/Cosmos/issues/2890#issuecomment-1888147007, or unsubscribe https://github.com/notifications/unsubscribe-auth/APV3ZH2ZQI627ZRU4FOS77DYOB3BHAVCNFSM6AAAAABBXDMAHWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBYGE2DOMBQG4 . You are receiving this because you authored the thread.Message ID: @.***>

ascpixi commented 7 months ago

As you're using Visual Studio: click on the file you want to embed; its properties should show in the "Properties" window. You can change the "Build Action" from there. image

alessiob07 commented 7 months ago

Oh thanks, now works!