locked
The type exists in both? RRS feed

  • Question

  • User-278693461 posted

    I get the following compilation error a lot in my page? Where am I going wrong? I have no idea what is going on so I do not even know what code to paste.

    Please advice.


    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0433: The type 'Laajakaistavertailu' exists in both 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll' and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll'

    Source Error:


    Line 36:                     CityID = Request.QueryString["CityID"];
    Line 37: // Lähetetään tradedoublerinfoon CityID. Käytetään master-sivun isossa bannerissa.
    Line 38: ((Laajakaistavertailu)Master).tradedoublerinfo = CityID;
    Line 39:
    Line 40: SqlConnection conn;

    Source File: c:\hshome\mannerv\mossi.bananahosting.com\City.aspx.cs    Line: 38


    Show Detailed Compiler Output:

    c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\assembly\dl3\e9ff1ef6\dc11f3fa_6b42c901\CSSFriendly.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.dll" /debug- /optimize+ /win32res:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\6drcqfwr.res" /w:4 /nowarn:1659;1699;1701  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.1.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.3.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.4.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.5.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.6.cs"


    Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.1433
    for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
    Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs(211,56): warning CS0436: The type '_Default' in 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs' conflicts with the imported type '_Default' in 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll'. Using the one in 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs'.
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs(13,22): (Location of symbol related to previous warning)
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll: (Location of symbol related to previous warning)
    c:\hshome\mannerv\mossi.bananahosting.com\City.aspx.cs(38,23): error CS0433: The type 'Laajakaistavertailu' exists in both 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll' and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll'
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll: (Location of symbol related to previous error)
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll: (Location of symbol related to previous error)
    c:\hshome\mannerv\mossi.bananahosting.com\Default_vanhatekniikka.aspx(77,59): error CS0117: 'ASP.default_vanhatekniikka_aspx' does not contain a definition for 'btnSearchTextbox_OnClick'
    Friday, February 27, 2009 4:44 PM

Answers

  • User11528697 posted

    Thanks for explaining your impleemtnation. From the errror message it sounds like that class "Laajakaistavertailu" in question used to be or still is there in other page as well. One is coming from master page as you explained. And then second is coming from a page which also has same name. I have a feeling that before you switched to using Master page model, you had a page with same class name. You probbaly made a copy of that page and left the old one there. And now when site is getting compiled, it is finding it both places now. See if thats the case. If it is, remove the file that you don't use any more. Do a quick string search across all files in your folder and see where all this class name appears.

    If all fails, purge the temporary asp.net folders.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 28, 2009 6:23 AM

All replies

  • User11528697 posted
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.6000.16809" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff>
    Most probably reason is that you have two assemblies in your project that reference different version of that component. Check on that.
     
    If that dors not turn out to be the reason, then try deleteing Temp ASP.Net files for your application. This could be a caching issue where two diffeent versions got stuck in temp.
     
    Most probably #1 is the reson for this error.
     
    N
     
    <markuso> wrote in message news:2972219@forums.asp.net...

    I get the following compilation error a lot in my page? Where am I going wrong? I have no idea what is going on so I do not even know what code to paste.

    Please advice.


    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0433: The type 'Laajakaistavertailu' exists in both 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll' and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll'

    Source Error:


    Line 36:                     CityID = Request.QueryString["CityID"];
    Line 37: // Lähetetään tradedoublerinfoon CityID. Käytetään master-sivun isossa bannerissa.
    Line 38: ((Laajakaistavertailu)Master).tradedoublerinfo = CityID;
    Line 39:
    Line 40: SqlConnection conn;

    Source File: c:\hshome\mannerv\mossi.bananahosting.com\City.aspx.cs    Line: 38


    Show Detailed Compiler Output:

    c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\assembly\dl3\e9ff1ef6\dc11f3fa_6b42c901\CSSFriendly.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.dll" /debug- /optimize+ /win32res:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\6drcqfwr.res" /w:4 /nowarn:1659;1699;1701  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.1.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.3.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.4.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.5.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.6.cs"


    Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.1433
    for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
    Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs(211,56): warning CS0436: The type '_Default' in 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs' conflicts with the imported type '_Default' in 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll'. Using the one in 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs'.
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_6drcqfwr.2.cs(13,22): (Location of symbol related to previous warning)
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll: (Location of symbol related to previous warning)
    c:\hshome\mannerv\mossi.bananahosting.com\City.aspx.cs(38,23): error CS0433: The type 'Laajakaistavertailu' exists in both 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll' and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll'
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_laajakaistavertailu.master.cdcab7d2.j7wmkzqd.dll: (Location of symbol related to previous error)
    c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6072423b\aedbe6c3\App_Web_unlmvwqi.dll: (Location of symbol related to previous error)
    c:\hshome\mannerv\mossi.bananahosting.com\Default_vanhatekniikka.aspx(77,59): error CS0117: 'ASP.default_vanhatekniikka_aspx' does not contain a definition for 'btnSearchTextbox_OnClick'


    http://forums.asp.net/p/1390957/2972219.aspx#2972219

    </BODY></HTML>
    Friday, February 27, 2009 5:56 PM
  • User-278693461 posted

    I am sorry, but I did not understand what you meant by "assemblies" and "that component". I will try to explain what I am trying to do.

    I have a page called City.aspx, with a parameter CityID passed to it like this: http://www.laajakaistavertailu.fi/City.aspx?CityID=79. This page will display broadband prices for different cities depending on the CityID.

    City.aspx uses as a master page Laajakaistavertailu.master. In the master page I have a header with a banner advertisement. I want to pass the CityID to that banner advertisement as a parameter. This is done so that the guy who runs the advertisements can see which CityID produces the most banner ad clicks.

    I try to pass the variable CityID from City.aspx.cs into Laajakaistavertailu.master.cs and then into Laajakaistavertailu.master.

    In City.aspx.cs I have:

    1    public partial class City : System.Web.UI.Page
    2 {
    3 const String DEFAULT_PAGE_TITLE = "Laajakaistavertailu.fi";
    4 String CityName = "";
    5 internal String CityID = "";
    6 protected void Page_Load(object sender, EventArgs e)
    7 {
    8 Page.Title = DEFAULT_PAGE_TITLE;
    9 lblSelectedCity.Text = "";
    10 if (!Page.IsPostBack)
    11 {
    12 if (!String.IsNullOrEmpty(Request.QueryString["CityID"]))
    13 {
    14 if (!Regex.IsMatch(Request.QueryString["CityID"], @"^[1-9]+[0-9]*$"))
    15 {
    16 lblError.Text = "Server side error. Query string was malformed.";
    17 }
    18 else
    19
    20 {
    21 CityID = Request.QueryString["CityID"];
    22 // This is how I pass the CityID into the master page
    23 ((Laajakaistavertailu)Master).tradedoublerinfo = CityID;
    24
    Then in Laajakaistavertailu.master.cs I create the variable tradedoublerinfo, so that it can get as the value the CityID:
     
    1    public partial class Laajakaistavertailu : System.Web.UI.MasterPage
    2 {
    3 public String home, technologies, operators, cities, blog;
    4 public String tradedoublerinfo = "";
    And finally at Laajakaistavertailu.master, I add the value of tradedoublerinfo (the integer from CityID) into the banner code: 
    1    <script type="text/javascript">
    2 var uri = 'http://impfi.tradedoubler.com/imp?type(js)g(16441956)a(1587729)epi(lkv<%=tradedoublerinfo%>)' + new String (Math.random()).substring (2, 11);
    3 document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    4 </script>
    Does this help into pointing into my error? 
    Also, I am not sure if this is of relevance, but I had another bug (Validation of viewstate MAC failed) before this and in order to remove that bug I put this in my Web.config
        <system.web>
    <pages enableEventValidation="false" viewStateEncryptionMode="Never" />
     
    Saturday, February 28, 2009 6:02 AM
  • User11528697 posted

    Thanks for explaining your impleemtnation. From the errror message it sounds like that class "Laajakaistavertailu" in question used to be or still is there in other page as well. One is coming from master page as you explained. And then second is coming from a page which also has same name. I have a feeling that before you switched to using Master page model, you had a page with same class name. You probbaly made a copy of that page and left the old one there. And now when site is getting compiled, it is finding it both places now. See if thats the case. If it is, remove the file that you don't use any more. Do a quick string search across all files in your folder and see where all this class name appears.

    If all fails, purge the temporary asp.net folders.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 28, 2009 6:23 AM
  • User-278693461 posted

    Okay, thanks, now I think I understood what the problem is. I am doing my development directly on the production server (I have not learned any other way yet) and I made a backup copy of my Master page by renaming it.

    I excluded the backup file from the project and now the error seems to be gone...

    I had no idea that all these files get compiled. I thought it only happened when someone requested the file. I actually have like 30 different .aspx files on the server that are for testing and stuff. I guess I have to clean up and learn how to develop on my local machine and "publish" to the hosting environment.

    Thanks a lot for your help!

    Saturday, February 28, 2009 8:03 AM