Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a project reference makes IL2CPU not be able to find the file #2947

Open
9xbt opened this issue Feb 10, 2024 · 2 comments
Open

Adding a project reference makes IL2CPU not be able to find the file #2947

9xbt opened this issue Feb 10, 2024 · 2 comments

Comments

@9xbt
Copy link
Contributor

9xbt commented Feb 10, 2024

Have you checked Github Issues for similar errors?
Yes

Exception

System.IO.FileLoadException: Could not load file or assembly 'SVGAIITerminal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Visual Studio Output Logs

Operación Compilar iniciada..
1>------ Operación Compilar iniciada: Proyecto: TestKernel, configuración: Debug Any CPU ------
1>C:\Users\Eric\source\repos\TestKernel\TestKernel\TestKernel.csproj : warning NU1603: PrismAPI 1.0.3 depende de Cosmos.HAL2 (>= 0.1.0-localbuild), pero no se encontró Cosmos.HAL2 0.1.0-localbuild. Se resolvió una mejor coincidencia aproximada de Cosmos.HAL2 0.1.0-localbuild20240208033845.
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2352,5): warning MSB3270: La arquitectura del procesador del proyecto que se va a compilar "MSIL" y la arquitectura del procesador de la referencia "C:\Users\Eric\Documents\GitHub\SVGAIITerminal\src\bin\Debug\net6.0\SVGAIITerminal.dll", "x86", no coinciden. Esta falta de coincidencia puede causar errores en tiempo de ejecución. Cambie la arquitectura del procesador de destino del proyecto mediante el Administrador de configuración para alinear las arquitecturas de procesador entre el proyecto y las referencias, o tome una dependencia de las referencias con una arquitectura de procesador que coincida con la arquitectura del procesador de destino del proyecto.
1>C:\Users\Eric\Documents\GitHub\SVGAIITerminal\src\SVGAIITerminal.csproj : warning NU1603: PrismAPI 1.0.3 depende de Cosmos.HAL2 (>= 0.1.0-localbuild), pero no se encontró Cosmos.HAL2 0.1.0-localbuild. Se resolvió una mejor coincidencia aproximada de Cosmos.HAL2 0.1.0-localbuild20240208033845.
1>Compilación del proyecto "SVGAIITerminal.csproj" terminada.
1>TestKernel -> C:\Users\Eric\source\repos\TestKernel\TestKernel\bin\Debug\net6.0\TestKernel.dll
1>Error : error occurred: System.IO.FileLoadException: Could not load file or assembly 'SVGAIITerminal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
1>   at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
1>   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
1>   at Cosmos.IL2CPU.IsolatedAssemblyLoadContext..ctor(IEnumerable`1 assemblyPaths) in C:\Users\Eric\Documents\GitHub\Cosmos\IL2CPU\source\Cosmos.IL2CPU\IsolatedAssemblyLoadContext.cs:line 43
1>   at Cosmos.IL2CPU.CompilerEngine..ctor(ICompilerEngineSettings aSettings) in C:\Users\Eric\Documents\GitHub\Cosmos\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 91
1>   at Cosmos.IL2CPU.Program.RunCompilerEngine(String[] aArgs, Action`1 aLogMessage, Action`1 aLogError) in C:\Users\Eric\Documents\GitHub\Cosmos\IL2CPU\source\Cosmos.IL2CPU\Program.cs:line 64
1>   at Cosmos.IL2CPU.Program.Run(String[] aArgs, Action`1 aLogMessage, Action`1 aLogError) in C:\Users\Eric\Documents\GitHub\Cosmos\IL2CPU\source\Cosmos.IL2CPU\Program.cs:line 47
1>IL2CPU task took 00:00:00.1008798
1>Compilación del proyecto "TestKernel.csproj" terminada -- ERROR.
========== Compilación: 0 correcto, 1 erróneo, 1 actualizado, 0 omitido ==========
========= Compilar se inició en 12:40 PM y tomó 00.476 segundos ==========

How To Reproduce
Add a reference to a project in VS

Screenshots

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

How to solve
Instead of doing this (which is what VS does by default)

<ItemGroup>
    <ProjectReference Include="..\..\..\..\Documents\GitHub\SVGAIITerminal\src\SVGAIITerminal.csproj" />
</ItemGroup>

Do this

<ItemGroup>
    <ProjectReference Include="..\..\..\Documents\GitHub\SVGAIITerminal\src\SVGAIITerminal.csproj" />
</ItemGroup>

For context, IL2CPU seems to be adding an extra ..\ before the project reference path which is not right

@9xbt
Copy link
Contributor Author

9xbt commented Feb 10, 2024

I'm looking at the IL2CPU and It's not that it's adding an extra ..\, it's something else

@9xbt
Copy link
Contributor Author

9xbt commented Feb 12, 2024

okay that only happens if theres a lot of ..\ for some reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant