I am trying to migrate a WPF app built under the old csproj format to the new csproj format defined for VS2017.
I've been able to get the app to compile, but I when I try to launch it in the debugger under VS2017 I get the following error message:
Unable to run your project. The "RunCommand" property is not defined.
Interestingly, if I double-click the exe within File Explorer it launches just fine.
FYI, the project was initially a console app, which I then modified to be a WPF app. Here's the csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LanguageTargets>$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>
<OutputType>winexe</OutputType>
<TargetFramework>net47</TargetFramework>
<ApplicationIcon />
<OutputTypeEx>winexe</OutputTypeEx>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Resources.Designer.cs" />
<Compile Update="Properties\Resources.Designer.cs" DesignTime="True" AutoGen="True" DependentUpon="Resources.resx" />
<Compile Update="Settings.Designer.cs" AutoGen="True" DependentUpon="Settings.settings" />
<None Update="Settings.settings" LastGenOutput="Settings.Designer.cs" Generator="SettingsSingleFileGenerator" />
<Page Include="**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" Exclude="App.xaml" />
<Compile Update="**\*.xaml.cs" SubType="Designer" DependentUpon="%(Filename)" />
<Resource Include="assets\*.*" />
<ApplicationDefinition Include="App.xaml">
<Generator>MsBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.6.0" />
<PackageReference Include="Autofac.Extras.CommonServiceLocator" Version="4.0.0" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="3.0.0" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.0.8" />
<PackageReference Include="MaterialDesignColors" Version="1.1.3" />
<PackageReference Include="MaterialDesignThemes" Version="2.3.0.823" />
<PackageReference Include="MvvmLightLibs" Version="5.3.0" />
<PackageReference Include="Serilog" Version="2.4.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\WPFUtilities\J4JUI\J4JUI.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>
Where is the RunCommand property set, and how do I set it?
Update
Playing around with the project settings, I configured the debug options to launch the executable created by the project (the default is to "run" the project).
This lets me launch the app in the debugger within VS 2017...and makes me think this might be a bug in VS 2017, with the RunCommand property not being defined by the build environment the way it should be.