Cosmos icon indicating copy to clipboard operation
Cosmos copied to clipboard

Unable to build using Visual Studio 2022

Open Entersjkhdfkjdhfksjf opened this issue 1 year ago • 22 comments

Have you checked Github Issues for similar errors? yes Exception Post the exception returned by Visual Studio

Visual Studio Output Logs Build started at 20:21... 1>------ Build started: Project: CosmosKernel2, Configuration: Debug Any CPU ------ Failed to restore C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj (in 1.29 sec). NuGet package restore failed. Please see Error List window for detailed warnings and errors. 1>C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1101: Unable to find package Cosmos.Debug.Kernel. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org, Package source 1>C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1101: Unable to find package Cosmos.Plugs. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org, Package source 1>C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1101: Unable to find package Cosmos.System2. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org, Package source 1>C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1101: Unable to find package Cosmos.Build. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org, Package source 1>Done building project "CosmosKernel2.csproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Build completed at 20:21 and took 02.147 seconds ==========

How To Reproduce Describe any changes done to a clean kernel for this error to occur. No changes were made. Just build the example kernel

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

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

Entersjkhdfkjdhfksjf avatar Jul 30 '24 14:07 Entersjkhdfkjdhfksjf

Also I am not sure how to confirm last three lines in context

Entersjkhdfkjdhfksjf avatar Jul 30 '24 15:07 Entersjkhdfkjdhfksjf

Do you have the Cosmos NuGet packages installed?

Schaapie-D2 avatar Aug 01 '24 13:08 Schaapie-D2

Also I am not sure how to confirm last three lines in context

You can confirm these by right clicking on your project. And then clicking on "Manage NuGet Packages..."

Schaapie-D2 avatar Aug 01 '24 13:08 Schaapie-D2

Also I am not sure how to confirm last three lines in context

You can confirm these by right clicking on your project. And then clicking on "Manage NuGet Packages..."

It seems to be installed

Entersjkhdfkjdhfksjf avatar Aug 01 '24 16:08 Entersjkhdfkjdhfksjf

Do you have the Cosmos VS Extension installed?

Schaapie-D2 avatar Aug 01 '24 16:08 Schaapie-D2

Do you have the Cosmos VS Extension installed?

yes

Entersjkhdfkjdhfksjf avatar Aug 01 '24 16:08 Entersjkhdfkjdhfksjf

hmm... maybe reinstall the packages?

And look if Project > Dependencies > Packages looks like this: image

Schaapie-D2 avatar Aug 01 '24 16:08 Schaapie-D2

hmm... maybe reinstall the packages?

And look if Project > Dependencies > Packages looks like this: image

no, It looks like this image

Entersjkhdfkjdhfksjf avatar Aug 02 '24 10:08 Entersjkhdfkjdhfksjf

can i see the project file (double click on your project)

EDIT: And do you use dev or user kit?

Schaapie-D2 avatar Aug 02 '24 10:08 Schaapie-D2

can i see the project file (double click on your project)

EDIT: And do you use dev or user kit?

I have tried both the kits. Also here is the project file

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <!--<RuntimeIdentifier>cosmos</RuntimeIdentifier>-->
        <Platform>cosmos</Platform>
        <SupportsX86Intrinsics>false</SupportsX86Intrinsics>
        <SelfContained>True</SelfContained>
    </PropertyGroup>

    <PropertyGroup>
        <EnableGDB>False</EnableGDB>
        <StartCosmosGDB>False</StartCosmosGDB>
        <VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
        <CosmosDebugPort>Serial: COM1</CosmosDebugPort>
        <Launch>VMware</Launch>
        <Profile>VMware</Profile>
        <Description>Use VMware Player or Workstation to deploy and debug.</Description>
        <PxeInterface>192.168.0.8</PxeInterface>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Cosmos.Build" Version="0-*" NoWarn="NU1604" />
        <PackageReference Include="Cosmos.Debug.Kernel" Version="0-*" NoWarn="NU1604" />
        <PackageReference Include="Cosmos.System2" Version="0-*" NoWarn="NU1604" />
        <PackageReference Include="Cosmos.Plugs" Version="0-*" NoWarn="NU1604" />
    </ItemGroup>

</Project>

Entersjkhdfkjdhfksjf avatar Aug 02 '24 11:08 Entersjkhdfkjdhfksjf

if you are using the latest dev kit, try putting this in <itemGroup>

<PackageReference Include="Cosmos.Build" Version="0.1.0-localbuild20240722114813" NoWarn="NU1604">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Cosmos.Plugs" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.Common" Version="0.1.0-localbuild20240722114820" />
<PackageReference Include="Cosmos.Core" Version="0.1.0-localbuild20240722114820" />
<PackageReference Include="Cosmos.Debug.Kernel" Version="0.1.0-localbuild20240722114820" NoWarn="NU1604" />
<PackageReference Include="Cosmos.HAL2" Version="0.1.0-localbuild20240722114820" />
<PackageReference Include="Cosmos.System2" Version="0.1.0-localbuild20240722114820" />
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20240722114820" />
<PackageReference Include="System.Console" Version="4.3.1" />

And if you are using user kit. Try installing dev kit because user kit is very outdated.

Schaapie-D2 avatar Aug 02 '24 11:08 Schaapie-D2

now, i am getting the following errors. (Yes, I reinstalled the dev kit)

Build started at 17:48...
1>------ Build started: Project: CosmosKernel2, Configuration: Debug Any CPU ------
Failed to restore C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj (in 5 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : warning NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageReference' items are: Cosmos.Build 0-*, Cosmos.Build 0.1.0-localbuild20240722114813; Cosmos.Debug.Kernel 0-*, Cosmos.Debug.Kernel 0.1.0-localbuild20240722114820; Cosmos.System2 0-*, Cosmos.System2 0.1.0-localbuild20240722114820; Cosmos.Plugs 0-*, Cosmos.Plugs 0-*.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'Cosmos.Common (>= 0.1.0-localbuild20240722114820)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'System.Console (>= 4.3.1)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'Cosmos.Debug.Kernel (>= 0.0.0)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'IL2CPU.API (>= 0.1.0-localbuild20240722114820)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'Cosmos.Plugs (>= 0.0.0)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'Cosmos.HAL2 (>= 0.1.0-localbuild20240722114820)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'Cosmos.Core (>= 0.1.0-localbuild20240722114820)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'Cosmos.System2 (>= 0.0.0)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>C:\Users\[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : error NU1100: Unable to resolve 'Cosmos.Build (>= 0.0.0)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org, Package source.
1>Done building project "CosmosKernel2.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 17:48 and took 01.184 seconds ==========

Entersjkhdfkjdhfksjf avatar Aug 02 '24 12:08 Entersjkhdfkjdhfksjf

hmm... The only thing I can think of is to restore the NuGet packages, because it seems that its an issue with Nuget. Not Cosmos.

This will help: https://github.com/NuGet/docs.microsoft.com-nuget/blob/main/docs/consume-packages/Package-Restore.md

TIP: remove the previous NuGet references in <itemGroup> to avoid duplicates that's what this warning was saying

1>C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : warning NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageReference' items are: Cosmos.Build 0-, Cosmos.Build 0.1.0-localbuild20240722114813; Cosmos.Debug.Kernel 0-, Cosmos.Debug.Kernel 0.1.0-localbuild20240722114820; Cosmos.System2 0-, Cosmos.System2 0.1.0-localbuild20240722114820; Cosmos.Plugs 0-, Cosmos.Plugs 0-*.

Schaapie-D2 avatar Aug 02 '24 12:08 Schaapie-D2

hmm... The only thing I can think of is to restore the NuGet packages, because it seems that its an issue with Nuget. Not Cosmos.

This will help: https://github.com/NuGet/docs.microsoft.com-nuget/blob/main/docs/consume-packages/Package-Restore.md

TIP: remove the previous NuGet references in <itemGroup> to avoid duplicates that's what this warning was saying

1>C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : warning NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageReference' items are: Cosmos.Build 0-, Cosmos.Build 0.1.0-localbuild20240722114813; Cosmos.Debug.Kernel 0-, Cosmos.Debug.Kernel 0.1.0-localbuild20240722114820; Cosmos.System2 0-, Cosmos.System2 0.1.0-localbuild20240722114820; Cosmos.Plugs 0-, Cosmos.Plugs 0-*.

You think reinstalling Visual Studio will work?

Entersjkhdfkjdhfksjf avatar Aug 02 '24 13:08 Entersjkhdfkjdhfksjf

hmm... The only thing I can think of is to restore the NuGet packages, because it seems that its an issue with Nuget. Not Cosmos.

This will help: https://github.com/NuGet/docs.microsoft.com-nuget/blob/main/docs/consume-packages/Package-Restore.md

TIP: remove the previous NuGet references in <itemGroup> to avoid duplicates that's what this warning was saying

1>C:\Users[username]\source\repos\CosmosKernel2\CosmosKernel2\CosmosKernel2.csproj : warning NU1504: Duplicate 'PackageReference' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageReference' items are: Cosmos.Build 0-, Cosmos.Build 0.1.0-localbuild20240722114813; Cosmos.Debug.Kernel 0-, Cosmos.Debug.Kernel 0.1.0-localbuild20240722114820; Cosmos.System2 0-, Cosmos.System2 0.1.0-localbuild20240722114820; Cosmos.Plugs 0-, Cosmos.Plugs 0-*.

You think reinstalling Visual Studio will work?

Entersjkhdfkjdhfksjf avatar Aug 02 '24 13:08 Entersjkhdfkjdhfksjf

no. I don't mean that😀. I meant restoring the packages. And if that doesn't work. I don't know what to do next.

Schaapie-D2 avatar Aug 02 '24 13:08 Schaapie-D2

Alright

Entersjkhdfkjdhfksjf avatar Aug 02 '24 13:08 Entersjkhdfkjdhfksjf

no. I don't mean that😀. I meant restoring the packages. And if that doesn't work. I don't know what to do next.

Restoring Failed. :( . Might just reinstall and see. It might just work

Entersjkhdfkjdhfksjf avatar Aug 02 '24 13:08 Entersjkhdfkjdhfksjf

you can try that

Schaapie-D2 avatar Aug 02 '24 13:08 Schaapie-D2

It's still not working 😭

Entersjkhdfkjdhfksjf avatar Aug 06 '24 14:08 Entersjkhdfkjdhfksjf

It is saying that it is launching a .dll, your project is configured incorrectly. It is probably configured incorrectly because Visual Studio 2022 can't find the packages, I think you might have to build the DevKit and install it.

TheVogels avatar Sep 13 '24 15:09 TheVogels

Have you made sure that tour project has The local Cosmos source selected in manage nuget packages

randomusert avatar Jan 22 '25 19:01 randomusert