1

I try to modify Target framework from .NET 4.6.1 to 4.6.2 in Project Properties window of VS2019.

Compilation of version 4.6.1 is OK.

Compilation of version 4.6.2 fails: error CS0101: The namespace 'CoreClient' already contains a definition for 'ClientCore'.

I have 7 files with

public partial class ClienCore {}

All of the classes into the same namespace CoreClient. The error message points only to one of file from them.

For test, when I rename/delete this partial class in the file to eliminate the error, the same error points to other file from these 7 after compilation.

Image below shows Properties window of the project

Yakov
  • 187
  • 1
  • 11

1 Answers1

1

My colleague found solution. The problem is hidden into files

Properties/Settings.Designer.cs

Properties/Resources.Designer.cs

ClientCore/Properties/Settings.Designer.cs

old line

  namespace CoreClient.CoreClient.Properties {

new line after fix the problem

  namespace CoreClient.Properties {

ClientCore/Properties/Resources.Designer.cs

old line

namespace CoreClient.CoreClient.Properties {
...
...
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CoreClient.CoreClient.Properties.Resources", typeof(Resources).Assembly);

new line after fix the problem

namespace CoreClient.Properties {
...
...
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CoreClient.ClientCore.Properties.Resources", typeof(Resources).Assembly);
Yakov
  • 187
  • 1
  • 11