"An item with the same key has already been added" when testing a plugin build

I kept getting the error when trying to run my built .sdlplugin in Trados:

"An item with the same key has already been added" 

along with something about CommandBars not working.

Seems silly now, but turns out if you try to build the same .sdlplugin here:

C:\Users\[Username]\AppData\Roaming\SDL\SDL Trados Studio\[version #]\Plugins\Packages

when you already have been building here:

C:\ProgramData\SDL\SDL Trados Studio\[version #]\Plugins\Packages

Then you cannot run your plugin in Trados.

Delete one of the .sdlplugin files from either location, probably the location that you don't have set as your build path, and delete the unpacked version from the Unpacked folder one directory up from Packages.

Then you should  be able to run your plugin again. Not really a question but fyi for those of you who run into this situation in the future.

Parents
  • You are absolutely right if you deploy the same .sdplugin file in 2 different location supported by Trados Studio you will end up with the error messages "An item with the same key has already been added" which means is trying to load the same plugin twice. Now this is most likely to happen on development machines and my personal recommendation would be to configure your plugin build output to be in bin\debug. I know this was configured differently in some older Visual Studio project templates but we fixed that in the latest SDK version. 

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

Reply
  • You are absolutely right if you deploy the same .sdplugin file in 2 different location supported by Trados Studio you will end up with the error messages "An item with the same key has already been added" which means is trying to load the same plugin twice. Now this is most likely to happen on development machines and my personal recommendation would be to configure your plugin build output to be in bin\debug. I know this was configured differently in some older Visual Studio project templates but we fixed that in the latest SDK version. 

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

Children
No Data