Visual Studio.Net – Build Error – “Error CS0229 Ambiguity between …”

Background

Experiencing error building a project in Visual Studio.

Error

Error Image

 

Error Message

  1. Error CS0229 Ambiguity between ‘_jobSummary’ and ‘_jobSummary’
  2. Error CS0121 The call is ambiguous between the following methods or properties: ‘ExecJobActionAsync(Func<DbConnection, Task<int>>)’ and ‘ExecJobActionAsync(Func<DbConnection, Task<int>>)’
  3. Error CS0229 Ambiguity between ‘IsEnabled’ and ‘IsEnabled’
  4. Error CS0229 Ambiguity between ‘IsRunning’ and ‘IsRunning’

 

Troubleshooting

After a full day’s work, realized that the source of the problem is that I had backed up one of the source code files before editing it.

Unfortunately, the backup file was placed in a folder underneath the project’s working directory.

Remediation

To correct please do one of the following :-

  1. Move the folders and files outside of the project’s working directory
  2. Explicitly exclude the folder or file from the project

 

Visual Studio .Net Project

Outline

  1. Choose the folders or files to exclude
    • Right click on your selection
    • From the drop-down menu, please choose Exclude

Image

Image – Exclude From Project ( Initiate )

 

Image – Exclude From Project ( Completed )

 

Review

Project

To review included and excluded files you can do the following :-

Outline

  1. Ensure that Solution Explorer is tailored to show all files
  2. Review each .csproj file

 

Image

Solution Explorer

Image – Show All Files

 

Project File ( .CSProj )

Image

Explain

  1. Upon reviewing the .csproj file we notice the following
    • A new ItemGroup
    • The Item is tagged with “Compile Remove

 

Summary

Please be careful where you place copied files as it might inadvertently be included in your project.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s