6

Cannot load " file reference ": Domain object with ID " guid " has already been defined in this or another domain model.

enter image description here

The file to be loaded is a DevExpress xpo data model file and the file itself has successfully loaded on at least 3 prior occasions.

I have searched for the ID guid on the whole hard disk without any result.

How can I fix this?

David
  • 958
  • 2
  • 12
  • 29

1 Answers1

1

The problem here is, you have already compiled the file. Look around in your build path for a compiled file, and either move or delete it. Whenever a file is already compiled in a location, the compiler tries to use its resources in the compilation of your new program. This then defines things multiple times, giving you this error.

Vendetta
  • 2,078
  • 3
  • 13
  • 31
  • 1
    You might also just have several copies of one of the files being compiled, just with different names. – Vendetta Feb 25 '20 at 15:23
  • 1
    I am unable to locate any duplicate files with the same content. I have deleted the bin and object directories. What is the likely extension for the compiled file? – David Feb 25 '20 at 23:36
  • 1
    @David .aspx .xpo .bin .exe .dll .cs .bat/.ps1(very unlikely) or .cmd(also very inlikely) – Vendetta Feb 25 '20 at 23:54
  • 1
    Oh, if you can compile and run in 2015, then this probably isn't your problem. When was the last time you were able to compile it in any version of vs? – Vendetta Feb 25 '20 at 23:55
  • Also, I found [this](https://enterprisecraftsmanship.com/posts/dont-use-ids-domain-entities/) and [this](https://stackoverflow.com/questions/5648060/an-item-with-the-same-key-has-already-been-added) – Vendetta Feb 25 '20 at 23:57
  • It might be easier if we can talk more efficiently than comments, if you have discord, add me at Fashionable Stubble#5505 If not, tell me your preferred method of communication. I need a bit more information to help you if the above solution didn't help. – Vendetta Feb 26 '20 at 00:03
  • Another issue might be that the process is already running. Check Task Manager and make sure there isn't anything still trying to execute. – Vendetta Feb 26 '20 at 00:05