The type <sometype> exists in both <frameworkdirectory> and <vsappdirectory> RRS feed

  • Question

  • Error 1 The type 'System.Data.SqlClient.SqlDataReader' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll' and 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\System.Data.SqlClient.dll' C:\StingrayII\Domains\Framework\Provider\CustomMembershipProvider.cs 234 39 SXA.PTL.Framework.Provider

    I am getting the above error in my project, and I'm not sure why, or what is causing it. This is just one example of this particular error. We've gotten similar errors on other *.dll's on the system from other projects. Can anyone tell me "why" I am getting this error?

    Here is the line that is causing it, it really just a function declaration:

    private System.Data.SqlClient.SqlDataReader PPValidateUser(string username, string password) {}
    // It is underlining the word SqlDataReader


    Thursday, June 1, 2006 5:35 PM

All replies

  • The compiler is trying to resolve the System.Data.SqlClient.SqlDataReader type reference, but it is finding it defined in more than one assembly that is being referenced.  Have you possibly referenced two different versions of the same .NET assembly in your project?
    Thursday, June 1, 2006 6:15 PM
  • Thanks - yeah, apparantly if both System.Data and System.Data.SqlClient are referenced, then the compiler picks up the namespace from both and "kablooie".
    Thursday, June 1, 2006 8:36 PM
  • I have a similar problem, only it is refering to DLLs in the Temporary ASP.NET Files folder.

    Error 1 The type 'PortalInfo' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\admin\409b9ecf\c3a7daa3\App_Code.bckca2vg.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\admin\409b9ecf\c3a7daa3\assembly\dl3\ecff1a12\3675b783_c491c601\Kpmg.Tax.Extranet.DLL' D:\TFS\IES_Extranet\2006\Admin\EE\toolkit\KPMGContacts.aspx.cs 40 

    Any thoughts?


    Saturday, June 17, 2006 4:25 AM
  • I found the fix:

    In the solution with the Admin project were several other related projects that were referenced in the Admin project.  I removed all of these other projects and then added them back.  After that I added the references back to the Admin Project.


    Saturday, June 17, 2006 5:03 AM
  • The fix I finally found was to right click on the solution and choose "clean solution". The problem is that the copy in VSS keeps getting corrupted from someone's PC. But all I have to do is run the clean, and it takes mere seconds.
    Sunday, June 18, 2006 2:00 PM
  • the above one is right.

    I meet this problom today. I try a lot methods to fix this error but fail,  untill see above solution “right click, and clear”.

    haha, thank  toddhd .

    Friday, August 5, 2011 3:00 AM
  • I followed these and I'm still getting the error...

    Error 1 The type 'Microsoft.Advertising.WinRT.UI.XamlAdControl_XamlTypeInfo.XamlMetaDataProvider' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MSAdvertisingXaml\6.1\References\CommonConfiguration\neutral\Microsoft.Advertising.WinRT.UI.winmd' and 'c:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MSAdvertisingXaml\6.1\References\CommonConfiguration\neutral\Microsoft.Advertising.WinRT.UI.winmd' C:\Users\David\Desktop\SimonSaid\SimonSaid\obj\Debug\XamlTypeInfo.g.cs 164 94 SimonSaid

    DavidJKelley, Microsoft MVP

    Tuesday, September 11, 2012 9:42 PM
  • I had the same error. I had two projects (A and B) that were referencing the same component dll but with different versions. Project A was depending on project B.

    Fix: reference the same version of the component DLL in dependent projects.

    Wednesday, March 20, 2013 10:11 AM
  • Event better, a whole namespace, turned out, in one of the base assemblies, was lately ported into SDK as a distinct assembly.

    In the end the time goes to get around to a thought that some base assembly would have same namespace implemented in some SDK assembly.

    All it took in the end is a deep breath and removal of a reference, just like you said.

    Thank you and cudos for sharing!

    Sunday, January 24, 2016 8:20 AM