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.

Carlos
  • 293
  • 1
  • 5
  • 16
  • 6
    http://stackoverflow.com/questions/5171257/why-am-i-having-an-ambiguous-type-error-when-calling-a-webmethod-on-asp-net-web, http://stackoverflow.com/questions/32658722/the-type-xxx-is-ambiguous-on-prod-server, and so on. – CodeCaster Nov 12 '15 at 16:04

2 Answers2

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.

Carlos
  • 293
  • 1
  • 5
  • 16
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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
RiverNet
  • 121
  • 1
  • 6