The type "..." is ambiguous: it could come from assembly "..." or from assembly "...". Please
Asked Answered
H

2

5

I'm developing a Web Application on Visual Studio 2013 and I have the next problem:

The type 'AddressMaintenance.App_Code.DAL.DataSetTableAdapters.VALUESTableAdapter' is ambiguous: it could come from assembly 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\47bb176a\b43c95ba\App_Code.xtamkrzu.DLL' or from assembly 'C:\inetpub\wwwroot\AddressMaintenance\bin\AddressMaintenance.DLL'. Please specify the assembly explicitly in the type name.

I've read on internet and other user questions and I didn't find the error. I have also tried to run the Application on IIS7 (not in the computer where I'm developing the Web) and I get the same error.

The code that makes the application to crash is:

<asp:ObjectDataSource
    ID="ODS_GetUsers"
    runat="server"
    SelectMethod="getUsers"
    TypeName="AddressMaintenance.App_Code.DAL.DataSetTableAdapters.USERSTableAdapter">
    <SelectParameters>
        <asp:Parameter DefaultValue="Active" Name="value_type" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>

Thank you in advance.

Hearttoheart answered 12/11, 2015 at 16:1 Comment(1)
#5171757, #32659222, and so on.Lester
H
11

I found the solution here http://vishaljoshi.blogspot.co.uk/2009/07/appcode-folder-doesnt-work-with-web.html

I renamed the App_Code folder to other one.

Thanks.

Hearttoheart answered 12/11, 2015 at 16:40 Comment(0)
P
1

This can happen when you create a class in one folder and then move it to another. This happened to me. I created several class files in the root folder of a web application project and then moved them to the App_Code folder. This created the same issue described in the OP.
The solution is to create a new folder, copy the files causing the problem to it, then delete the original folder they were in. Rebuild your project, and all should be right with the world.

Publicize answered 11/3, 2021 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.