Comments (5)
I can repro it in my local machine
from home.
@snorrk Hi! I investigated a little bit and looks that the problem is that your project extension .proj
doesn't import the necessary targets, basically is not supported to have a .proj
extension and Microsoft.NET.Sdk
project. Can you try do rename the project file to .csproj
and see if it works? Thanks!
from home.
Not being able to restore using static graph with Microsoft.NET.Sdk is the point of this issue.
Sdk.targets says:
This means support for different languages could either be supplied via an SDK or via a NuGet package
This does not work when static graph is enabled (but does when it is disabled).
I believe that is a bug, the behavior should be consistent regardless of the static graph setting?
from home.
@snorrk what happens when you build the project?
D:\repros\duplicate-net40>msbuild /clp:v=n;summary;forcenoalign
MSBuild version 17.9.5+33de0b227 for .NET Framework
Build started 3/12/2024 3:18:20 PM.
Project "D:\repros\duplicate-net40\Project.proj" on node 1 (default targets).
C:\Program Files\Visual Studio 2022\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(1248,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [D:\repros\duplicate-net40\Project.proj]
_CleanRecordFileWrites:
Creating directory "obj\Debug\".
Done Building Project "D:\repros\duplicate-net40\Project.proj" (default targets) -- FAILED.
Build FAILED.
Since the project file's extension is .proj
, the Microsoft.NET.Sdk
does not import the C# targets that enable multi-targeting. Since the value of <TargetFrameworks />
isn't interpreted by the SDK when the project file extension isn't .proj
, it defaults to .NET Framework v4.0.
https://learn.microsoft.com/dotnet/core/project-sdk/overview#project-files
If you're building a C# library or application, the project file must end in .csproj
. If your project is not compiling an C# program or library, consider Microsoft.Build.NoTargets.
from home.
This issue has been automatically marked as stale because we have not received a response in 14 days. It will be closed if no further activity occurs within another 14 days of this comment.
from home.
Related Issues (20)
- Fetch transitive packages for all PM UI levels
- Change algorithm to compute transitive origins for each project
- Show vulnerability data for solution-level transitive packages
- Show transitive status of package for each project in Solution-level Details Pane
- Drive insertion of new dependency graph resolution algorithm
- Add property for toggling the to the previous NuGet resolver: RestoreUseLegacyDependencyResolver HOT 1
- Document: RestoreUseLegacyDependencyResolver
- dotnet list package should warn when restore is not current
- Latest NuGet Version not displaying correctly in Visual Studio Code HOT 1
- Vulnerabilities filter is not showing vulnerable packages in Solution PM UI HOT 1
- NuGet Search box in VS Win is teeny tiny on higher resolution devices
- dotnet restore should report security vulnerabilities for shared assembly projects.
- update dotnet nuget why docs for optional path argument
- The "RestoreTask" task returned false but did not log an error HOT 2
- Nuget: Central Directory corrupt HOT 3
- LockFileUtils.CreateLockFileTargetProject allocates a lot
- [Bug Bash] The package versions are inconsistent in the “Project” node and the “Packages” node of the Solution Explorer window after updating the parent project package HOT 2
- [Build][Source-Build] Multiple code style rule violations prevent successfull build of this repo and dotnet/dotnet repo
- Error reports of invalid or missing transitive NuGet dependencies are unusable
- <vulnerabilityDataSource> in Nuget.config not working if Nuget.org is added as a disabled package source HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home.