question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

net40-client class library does not build

See original GitHub issue

Steps to reproduce

  1. dotnet new --type lib a project.json
  2. Target net40-client and net45
  3. dotnet migrate
  4. dotnet build3 -f net45
  5. 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:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joelverhagencommented, Oct 13, 2016

Workaround

Add <OutputType>Library</OutputType> to the .csproj.

0reactions
nguerreracommented, Oct 13, 2016

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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found