locked
Namespace Conflicts in ASP.NET RRS feed

  • Question

  • Hello, Everybody.
    This is Yamada  from Japan

    I use asp.net to create a test website. And try to use methods defined in a dll library project, which is in the same solution.

    This is my solution  structure:

    --Solution Test

      |--  Test website

            |-- Default.aspx

                - Default.aspx.cs

      |--   Test.ABC  dll project

    When try to using Test.ABC dll's namespace in file Default.aspx.cs,

    It shows the following error:

    ---------error message--------

    The namespace 'Test' in 'D:\VS2010\MyTest\Test\Bin\Test.ABC.dll' conflicts with the type 'Test' in 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\test\988f426b\_shadow\ac9cadbe\1307619689\30397984\App_Web_test.master.cdcab7d2.xpx-bgyf.dll'

    ---------------------------------

    My development environment:
    dev: VS2010 SP1
    OS:  Win7 32bit

    Any help would be appreciated.



    • Edited by YanBingFX Monday, September 22, 2014 5:18 AM
    • Moved by Caillen Tuesday, September 23, 2014 1:51 AM
    Monday, September 22, 2014 5:17 AM

Answers

  • Please post questions related to ASP.NET in the ASP.NET forums (http://forums.asp.net ).

    In regards to your question the issue is that you have code defined in 2 places.  The first place is in your class library.  The second place is in your ASP.NET site.  Remove the type from your ASP.NET site project and it should run.

    Michael Taylor
    http://blogs.msmvps.com/p3net

    • Proposed as answer by Caillen Tuesday, September 23, 2014 1:51 AM
    • Marked as answer by YanBingFX Tuesday, September 23, 2014 2:57 AM
    Monday, September 22, 2014 2:25 PM

All replies

  • Please post questions related to ASP.NET in the ASP.NET forums (http://forums.asp.net ).

    In regards to your question the issue is that you have code defined in 2 places.  The first place is in your class library.  The second place is in your ASP.NET site.  Remove the type from your ASP.NET site project and it should run.

    Michael Taylor
    http://blogs.msmvps.com/p3net

    • Proposed as answer by Caillen Tuesday, September 23, 2014 1:51 AM
    • Marked as answer by YanBingFX Tuesday, September 23, 2014 2:57 AM
    Monday, September 22, 2014 2:25 PM
  • You asked the same question in the VB and C# forums, which was responded to twice in the VB forum. Your solution is to name the Web project something else other than "Test" that produced the namesspace called "Test", which is a namespace that was already in use in the .NET Framework 4.0.
    Monday, September 22, 2014 2:58 PM
  • Michael Taylor

    Thank you very much.

    Tuesday, September 23, 2014 2:58 AM