Reputation: 549
I created a project in Visual Studio 2022 with the main template "ASP.NET Web Application (.NET Framework)" and sub template "Web API".
This created a project with the ValuesController.
However, when I run the project and visit the url https://localhost:44342/api/values, I get the error:
This site can’t be reached
What do I have to do, to make this project work?
This is .NET Framework, not .NET Core, there is no launchSettings.json. The port is defined in the project file.
In the vbproj, there is this piece of xml:
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>53888</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>https://localhost:44342/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
Upvotes: 1
Views: 755