net40-client class library does not build
See original GitHub issueSteps to reproduce
dotnet new --type lib
a project.json- Target
net40-client
andnet45
dotnet migrate
dotnet build3 -f net45
dotnet build3 -f net40-client
Expected behavior
Both net45
and net40-client
builds should result in a .dll (pass /target:library
to csc
).
Actual behavior
net45
build works fine. net40-client
build fails:
CSC: error CS5001: Program does not contain a static 'Main' method suitable for an entry point
Environment data
Tried latest SDK package (1.0.0-alpha-20161013-1).
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview3-003842)
Product Information:
Version: 1.0.0-preview3-003842
Commit SHA-1 hash: 3ae14ab618
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Class library breaks when targeted to .NET 4 Client Profile
My new project needs to reference a number of other class libraries in my solution, but it fails to do so for each...
Read more >Tutorial: Create a .NET class library using Visual Studio
In this tutorial, you create a simple class library that contains a single string-handling method. A class library defines types and methods ...
Read more >Multi-Targeting and Porting a .NET Library to .NET Core 2.0
I used the StringUtils class and it just ported without any issues. Because the features used in these utilities are based on core...
Read more >Porting a .Net Framework Library to .Net Core
Net framework project is actually to create a new .Net Core class library and copy the old C# files into it. Assuming you...
Read more >Building A .NET Core Class Library
This tutorial explains how to build a class library in .NET Core using C# and Visual Studio 2019.
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 FreeTop 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
Top GitHub Comments
Workaround
Add
<OutputType>Library</OutputType>
to the .csproj.The reason is the same as #270, anything incompatible with netstandard1.0 will not get any of our targets and then behave as the bug that no restore -> build for net40 without any of our logic.