I have recently changed some projects from IIS ASP NET projects to Console Applications, using a custom web server. In both kinds of project, we ran the project as a console aplication (so we didn't actually use IIS),
However, as a web project, the profiler does not work. So we changed the project to be a console application, which makes the profiler work. Unfortunately, this removed the option to run a web browser and attach the debugger automatically. This appears in visual studio like so:
Console Application:
Web Project:
Is there a way to get this back whilst still being a console application?
I've tried adding this to the .csproj:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>52826</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:53107/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>True</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
<servers defaultServer="SelfHostServer">
<server name="SelfHostServer" exePath="" cmdArgs="-c http://localhost:52826/" url="http://localhost:52826" workingDir="" />
</servers>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
But this didn't seem to help. The more modern .net core apps seem to be console applications as well, but they somehow can start the browser and attach the debugger. We are using visual studio 2017, but we will happily upgrade to 2019 to fix the problem. The JetBrains Rider IDE also seems to be able to start a web browser and debug on any kind of project as well.