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.

Attempting to run a NetStandard class library that's been turned into a console app shows an error about "RunCommand" missing

See original GitHub issue

Ported from https://github.com/dotnet/roslyn-project-system/issues/1309

  1. Create a new C# .NetStandard library.
  2. Open properties pages and change the Application type to Console Application.
  3. Add a static Main method to the class.
  4. F5
---------------------------
Microsoft Visual Studio
---------------------------
Unable to run your project. The "RunCommand" property is not defined.
---------------------------
OK   
---------------------------

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:12
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
GrahamTheCodercommented, Nov 23, 2018

Relatedly, ASP NET non-core works so long as RunComand property is defined and a few other things like this:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <OutputType>Library</OutputType>
    <OutputPath>bin\</OutputPath>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <RunCommand>$(MSBuildExtensionsPath64)\..\IIS Express\iisexpress</RunCommand>
    <RunArguments>/path:&quot;$(MSBuildProjectDirectory)&quot; /port:18082</RunArguments>
  </PropertyGroup>
  ...rest of file...
</Project>

Obviously use whatever port and IIS bitness you want

(Improved thanks to @rainersigwald)

3reactions
rjperescommented, Sep 22, 2017

Any news on this? How can we go around it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

visual studio 2017 - Console App (.Net Standard) not listed
[EDIT] I have attempted to run devenv /installvstemplates but the devenv command is not found. I found it located here: C:\Program Files (x86)\ ......
Read more >
C# console app template generates top-level statements
The .NET 6+ project template for C# console apps uses top-level statements. Understand what changed and how to use existing learning ...
Read more >
Cannot debug net6.0-macos Apps - Developer Community
When I hit debug, the following error is shown in the Terminal: Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >
Grpc internal error. I am using WinHttpHandler as was mentio
gRPC is an open-source RPC framework that is created and used by Google. ... When i try to run in on local it...
Read more >
Multi-Targeting and Porting a .NET Library to .NET Core 2.0
I've been holding off porting any of my full frameworks to .NET Core. With the latest .NET Core 2.0 and .NET Standard 2.0...
Read more >

github_iconTop Related Medium Post

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