Open shaunluttin opened 7 years ago
When you look at the "play" button in visual studio, what does it say for the project that runs dotnet.exe
?
I'm afraid I lack such a button. In which toolbar does it exist?
When I start debugging, though, I see this:
Process: [2880] dotnet.exe
I think he means the "Start" button.
It was in the aptly named "Standard" toolbar. Now that solves it. When choosing IIS Express, the message is.
The project doesn't know how to run the profile IIS Expres.
Answer: http://stackoverflow.com/questions/37569112/visual-studio-2015-cant-start-iis-express
It might be a problem with how Visual Studio creates an xproj when first opening an existing .NET Core project. On opening in Visual Studio 2015, we get this xrproj.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>1b2fc342-5f98-4193-bea1-141a9bc557d9</ProjectGuid>
<RootNamespace>2016-101DP-TreeGame-Auth</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
This is the modification that worked.
- <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
+ <Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
I have two xprojs in the same solution. When I run one, it runs with IIS Express as expected. When I run the other, it runs from the command line, which is unexpected. I've checked the launchSettings.json, and it seems to be the same for both.
This is the one that works as expected.
This is the one that does not work as expected.