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

Unable to build using Visual Studio 2022 #3055

Open
Entersjkhdfkjdhfksjf opened this issue Jul 30, 2024 · 21 comments
Open

Unable to build using Visual Studio 2022 #3055

Entersjkhdfkjdhfksjf opened this issue Jul 30, 2024 · 21 comments

Comments

@Entersjkhdfkjdhfksjf
Copy link

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
Copy link
Author

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

@Schaapie-D2
Copy link

Do you have the Cosmos NuGet packages installed?

@Schaapie-D2
Copy link

Schaapie-D2 commented Aug 1, 2024

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..."

@Entersjkhdfkjdhfksjf
Copy link
Author

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

@Schaapie-D2
Copy link

Do you have the Cosmos VS Extension installed?

@Entersjkhdfkjdhfksjf
Copy link
Author

Do you have the Cosmos VS Extension installed?

yes

@Schaapie-D2
Copy link

hmm... maybe reinstall the packages?

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

@Entersjkhdfkjdhfksjf
Copy link
Author

hmm... maybe reinstall the packages?

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

no, It looks like this
image

@Schaapie-D2
Copy link

Schaapie-D2 commented Aug 2, 2024

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

EDIT:
And do you use dev or user kit?

@Entersjkhdfkjdhfksjf
Copy link
Author

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>

@Schaapie-D2
Copy link

Schaapie-D2 commented Aug 2, 2024

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.

@Entersjkhdfkjdhfksjf
Copy link
Author

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 ==========

@Schaapie-D2
Copy link

Schaapie-D2 commented Aug 2, 2024

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-*.

@Entersjkhdfkjdhfksjf
Copy link
Author

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?

1 similar comment
@Entersjkhdfkjdhfksjf
Copy link
Author

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?

@Schaapie-D2
Copy link

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.

@Entersjkhdfkjdhfksjf
Copy link
Author

Alright

@Entersjkhdfkjdhfksjf
Copy link
Author

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

@Schaapie-D2
Copy link

you can try that

@Entersjkhdfkjdhfksjf
Copy link
Author

It's still not working 😭

@TheVogels
Copy link

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.

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

4 participants