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:
- 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
- Manually validate the library project and the automation project could give more insights into the one that is referencing the class again
- Check if there are any dependency mismatches between the library process and the original project
- Check if the XAML file is referencing Systems.Collection.ObjectModel twice (Multiple entries) .