Visual Studio .NET .NET Build Error "There is another partial declaration of this type"

I am not a very experienced developer in the Windows world, and I have a problem that needs some explanation. I hope that in my ignorance I will miss something obvious.

I had to uncompile a precompiled .NET site / application. The reflection managed to get me the C # CodeFile that I needed, and I spent a lot of time modifying all the .aspx links from these things:

<%@ page language="C#" autoeventwireup="true" inherits="someclassname, App_Web_Z8sdf" %>

for things like this:

<%@ page language="C#" autoeventwireup="true" CodeFile="somefilename.aspx.cs" inherits="someclassname" %>

and moving the aspx.cs files to the same directory as the .aspx files.

This led me to the fact that I could actually load the project in a slightly editable form in Visual Studio. I have tried this since 2010 and 2008.

Now, however, I am trying to build this project. The error I am getting is:

"Missing partial modifier on declaration of type 'someclassname'; another partial declaration of this type exists"

. , , "" , . aspx.cs, .

"The type 'someclassname' already contains a definition for 'some variable name".

, - . unix, , , . aspx, , , aspx.cs, , . .

, , Visual Studio "" , , , VS, - . , - . , ? , web.config , ?

.

    using System;
    using System.Web;
    using System.Web.Profile;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class Some_Class_Name : Page, IRequiresSessionState
    {
        /// a bunch of variables defined like this
        protected HtmlForm form1;

       ///a bunch of protected methods defined similarly to this

        protected void LinkButtonReturn_Click(object sender, EventArgs e)
        {
            this.Session.Clear();
            base.Response.Redirect("Default.aspx");
        }

}

. . .aspx.cs ( , " " ), , , . , , aspx, aspx.cs . , .

+5
3

, , aspx. , , , , form1.

, . : WebForms, .

+2

, .NET- Reflector.

, , "CodeFile =..." ASPX. ASP.NET CodeFile, (.. ). CodeFile CodeBehind .

, - .

+4

, - WCF. - - , , .

, - , .

0
source

All Articles