Can't build for net46 (net451, net452 works fine)
See original GitHub issueSteps to reproduce
Use the https://github.com/aspnet/cli-samples/tree/master/HelloMvc sample.
Add net46 as the target framework
Restore (restores fine)
Build (dotnet build -f net46
)
Expected behavior
Project builds successfully
Actual behavior
PS C:\Source\cli-samples\HelloMvc> dotnet build -f net46
Project HelloMvc (.NETFramework,Version=v4.6) will be compiled because expected outputs are missing
Compiling HelloMvc for .NETFramework,Version=v4.6
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Diagnostics.FileVersionInfo >= 4.0.0-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Diagnostics.StackTrace >= 4.0.1-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Text.Encoding.CodePages >= 4.0.1-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Threading.Thread >= 4.0.0-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Xml.XmlDocument >= 4.0.1-rc2-24027 could not be resolved.
C:\Source\cli-samples\HelloMvc\project.json(15,42): error NU1001: The dependency System.Xml.XPath.XDocument >= 4.0.1-rc2-24027 could not be resolved.
Compilation failed.
0 Warning(s)
6 Error(s)
Time elapsed 00:00:00.0945403
Note when targeting net451 or net452 the project builds just fine.
Environment data
dotnet --info
output:
PS C:\Source\cli-samples\HelloMvc> dotnet --info
.NET Command Line Tools (1.0.0-rc2-002670)
Product Information:
Version: 1.0.0-rc2-002670
Commit Sha: f0018642a9
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (11 by maintainers)
Top Results From Across the Web
Open .net framework 4.5 project in VS 2022. Is there any ...
I ran into the same issue after uninstalling Visual Studio 2019. The build worked as expected from Visual Studio and the CLI after...
Read more >Target frameworks in SDK-style projects - .NET
When you target a framework in an app or library, you're specifying the set of APIs that you'd like to make available to...
Read more >Multi-targetting .Net Framework and .Net Core in a single project
A 15-second guide and 15-minute walk through. You have a .Net Core project, whether a netstandard library, or a netcore app, and you'd...
Read more >DocumentFormat.OpenXml 2.20.0
The Open XML SDK provides tools for working with Office Word, Excel, and PowerPoint documents. It supports scenarios such as:
Read more >Building a project that target .NET Framework 4.5 in Visual ...
Strangely, building from the command line with dotnet build still works fine. OK, fine, I'll just install the targeting pack for .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, @moozzyk. I came back to Core after 8-10 months. It seems I need to go to release notes and docs etc.