dotnet / dotnet/project-system

For multi-tfm projects that contain a class with the designer attribute constantly set and resets the designer attribute

Open
#2,001 3 comments 1 reaction 1 assignee Claimed by @tmeschter View on GitHub
Feature-Multi-Targeting Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

Reported here - https://developercommunity.visualstudio.com/content/problem/38882/project-that-targets-both-net46-and-netstandard15.html

----------------

Version. Visual Studio 2017 RTM. All extensions disabled.
1. Start with an empty .NET Standard class library project. Edit the project file to so that it targets net46 and netstandard1.5 (e.g. net46;netstandard1.5) - this actually fails with any version of net and netstandard.
2. Add class that is a subclass of System.ComponentModel.Component. It can be as simple as this:
```csharp
#if NET46
using System.ComponentModel;
namespace ClassLibrary1
{
public class ComponentSubclass : Component
{
}
}
#endif
```
3. Observe that the project file is constantly changing. Visual Studio seems to be constantly adding/removing the following:
```xml


Component


```
As a result, the project and any other projects referencing this project are constantly recompiling.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.