Project-system: Changing project properties adds unnecessary empty ApplicationIcon and StartupObject

Created on 31 Jan 2019  路  5Comments  路  Source: dotnet/project-system

Visual Studio Version:

Microsoft Visual Studio Enterprise 2019 Int Preview
Version 16.0.0 Preview 3.0 [28529.153.d16.0]
VisualStudio.16.IntPreview/16.0.0-pre.3.0+28529.153.d16.0

Summary:

Changing project properties adds unnecessary empty ApplicationIcon and StartupObject properties to project file.

Steps to Reproduce:

  1. File -> New Project -> Console App (.NET Core)

  2. Inspect project file

  3. Right click project, properties

  4. Change output type to Windows Application

  5. Inspect project file again

Expected Behavior:

Only change in project file is s/Exe/WinExe/

Actual Behavior:

Two extra lines are added to project file setting ApplicationIcon and StartupObject to empty.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
-   <OutputType>Exe</OutputType>
+   <OutputType>WinExe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
+   <ApplicationIcon />
+   <StartupObject />
  </PropertyGroup>

</Project>

User Impact:

Unwanted, unnecessary content in csproj file

Area-External-CPS Bug Feature-RuleProperties Triage-Approved

All 5 comments

These empty elements would override imported properties too.

Oh that's worse. I thought it was merely persisting the evaluated empty value and hoping if it were non-empty from imports it would reflect that.

I thought it was merely persisting the evaluated empty value

You're right 馃憤. Just tested this out and it copies the evaluated value into the file.

Was this page helpful?
0 / 5 - 0 ratings