Roslyn: async Main with multiple entrypoints

Created on 22 Apr 2018  路  8Comments  路  Source: dotnet/roslyn

I have three console apps in a project with Main entrypoints. I changed one of them to be "async Task Main". Now, when I go into the project properties, the one that I set to async no longer shows up in the "Startup object" application setting. The two that I left alone still show up.

_This issue has been moved from https://developercommunity.visualstudio.com/content/problem/235706/async-main-with-multiple-entrypoints.html
VSTS ticketId: 602403_
_These are the original issue comments:_
(no comments)
_These are the original issue solutions:_
(no solutions)

Area-IDE Bug Developer Community Need More Info help wanted

Most helpful comment

This issue concerns this dropdown:
image

All 8 comments

I cannot repro this issue on the latest 15.7.6

image

Closing this issue as no repro, pls revert if it repros with latest VS .

This issue concerns this dropdown:
image

in case anyone else runs into this ... you can manually add this to your csproj file and get passed this issue

<PropertyGroup>
   ... 
   <StartupObject>Name.Space.ClassWithMain</StartupObject>
   ...
<PropertyGroup>

VS: 16.5.0 Preview 4.0
.NET: 4.8

Startup object's dropdown-list doesn't work with an async Task Main method, it shows empty (see @sharwell comment). If I change its signature to void Main, then it shows up.

Confirmed with 2019 16.4.5.

@aktxyz's solution sort of works, but when I switch between startup objects it likes to remove the async one. So it works if you're willing to go into the xml and keep pasting it - not a real solution, unfortunately.

it wouldn't be a good work around without an annoying side effect ... for the longest time I could not figure out why it kept reverting but eventually found what you found

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OndrejPetrzilka picture OndrejPetrzilka  路  3Comments

asvishnyakov picture asvishnyakov  路  3Comments

codingonHP picture codingonHP  路  3Comments

glennblock picture glennblock  路  3Comments

binki picture binki  路  3Comments