System.ArgumentException: No Compiled Code To Run Error BC31051: Namespace Or Type 'System.Collections.ObjectModel' Has Already Been Imported

System.ArgumentException: No compiled code to run error BC31051: Namespace or type 'System.Collections.ObjectModel' has already been imported issue when the library process is imported in to the current project.

Scenario: When the library process is created and imported to the current project.

Troubleshooting steps:

  1. Based on the error message, it looks like the library project and the automation project are referencing to import the "System.Collections.ObjectModel" class together which results in the above error
  2. Manually validate the library project and the automation project could give more insights into the one that is referencing the class again
  3. Check if there are any dependency mismatches between the library process and the original project
  4. Check if the XAML file is referencing Systems.Collection.ObjectModel twice (Multiple entries) .