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

Not able to build SDK on local #2452

Open
MartinM85 opened this issue Apr 23, 2024 · 2 comments
Open

Not able to build SDK on local #2452

MartinM85 opened this issue Apr 23, 2024 · 2 comments
Labels

Comments

@MartinM85
Copy link
Contributor

Describe the bug

I have been facing a problem for two weeks with building the solution on my local. It starts happening after the last update of Visual Studio 2022 and all .NET SDKs.

Output from Package Manager

Failed to restore C:\Work\msgraph-sdk-dotnet\src\Microsoft.Graph\Microsoft.Graph.csproj (in 4 ms).
Failed to restore C:\Work\msgraph-sdk-dotnet\tests\Microsoft.Graph.DotnetCore.Test\Microsoft.Graph.DotnetCore.Test.csproj (in 73 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Time Elapsed: 00:00:00.1237384
========== Finished ==========

image

Error List

image

Attempt to build

image

Before the last update of VS 2022 and all .NET SDKs, everything worked fine. I have these SDKs installed

image

I don't have .NET SDK v5 installed for two years.

Expected behavior

I'm able to build SDK on my local machine.

How to reproduce

Hard to say, probably install the same .NET SDKs

image

Together with VS 2022 17.9.6

SDK Version

=5.48.0

Latest version known to work for scenario above?

5.47.0

Known Workarounds

No response

Debug output

Build started at 8:24 AM...
1>------ Build started: Project: Microsoft.Graph, Configuration: Debug Any CPU ------
Failed to restore C:\Work\msgraph-sdk-dotnet\src\Microsoft.Graph\Microsoft.Graph.csproj (in 2 ms).
Failed to restore C:\Work\msgraph-sdk-dotnet\tests\Microsoft.Graph.DotnetCore.Test\Microsoft.Graph.DotnetCore.Test.csproj (in 39 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>C:\Program Files\dotnet\sdk\8.0.204\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'C:\Work\msgraph-sdk-dotnet\src\Microsoft.Graph\obj\project.assets.json' doesn't have a target for 'netstandard2.1'. Ensure that restore has run and that you have included 'netstandard2.1' in the TargetFrameworks for your project.
1>Done building project "Microsoft.Graph.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\8.0.204\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'C:\Work\msgraph-sdk-dotnet\src\Microsoft.Graph\obj\project.assets.json' doesn't have a target for 'netstandard2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project.
1>Done building project "Microsoft.Graph.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\8.0.204\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'C:\Work\msgraph-sdk-dotnet\src\Microsoft.Graph\obj\project.assets.json' doesn't have a target for 'net5.0'. Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project.
1>Done building project "Microsoft.Graph.csproj" -- FAILED.
2>------ Build started: Project: Microsoft.Graph.DotnetCore.Test, Configuration: Debug Any CPU ------
2>C:\Work\msgraph-sdk-dotnet\tests\Microsoft.Graph.DotnetCore.Test\Microsoft.Graph.DotnetCore.Test.csproj : error NU1201: Project Microsoft.Graph is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Project Microsoft.Graph does not support any target frameworks.
2>Done building project "Microsoft.Graph.DotnetCore.Test.csproj" -- FAILED.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 8:24 AM and took 02.487 seconds ==========

Configuration

  • OS: Windows 11
  • Architecture: x64

Other information

No response

@MartinM85 MartinM85 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Apr 23, 2024
@MartinM85 MartinM85 changed the title Not able to restore dep build SDK on local Not able to build SDK on local Apr 23, 2024
@andrueastman
Copy link
Member

Thanks for raising this @MartinM85

Just to confirm, is this only happening on Visual Studio? Do you get a different result when running the .NET CLI to build?

@andrueastman andrueastman added Needs: Author Feedback and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Apr 26, 2024
@MartinM85
Copy link
Contributor Author

@andrueastman dotnet build works fine, but it didn't resolve issue with dependencies from the first screenshot when I open the solution in Visual Studio.

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

No branches or pull requests

2 participants