An array of C#, PHP, and HTML programming articles, tutorials, and resources

Posts Tagged ‘ The type exists in both ’

While migrating an old application from Visual Studio 2003 to Visual Studio 2008, I came across what seemed to be a dll mismatch error. I had to remove the original dll from the references because of conflicts with the new 3.5 framework to a new version of the dll as found in the 3rd party clients default installation location (somewhere in C:\Program Files). After this change, visits to a page that utilizes the 3rd party dll would crash with this error (where dll1 was the temporary location of the original dll and dll2 was the temporary location of the new dll):

CS0433: The type exists in both [dll1] and [dll2]

The old dll temporary location was at C:\Windows\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files and the new dll temporary location was at C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. Note that these locations will vary depending on the Microsoft.NET framework version you are using.

My first thought was that the temporary location somehow got out of sync, so I decided to rebuild the solution, but this was unsuccessful. My next idea was the delete both temporary folders, but had problems because the folders were locked. The last thing I tried was to manually add a copy of the dll to the Solution’s bin folder and reference that specific copy. This fixed the problem!