C#.net web application compiling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mgriggs
    New Member
    • Oct 2008
    • 2

    C#.net web application compiling

    I have been searching the web for days no with no luck. This seems to be a pretty unique problem.

    Currently I am creating a web application for a company and my co-workers and I have run into a major snag with integrating this new web application into the current site. There are 3 base classes that exist in the current site that must be used in the new application. Unfortunately, over the years, with so much contract work done, the entire site looks somewhat like Frankenstien's monster and most of it is not compiled. Every page and project requires these 3 classes to run but they have not been put into a compiled dll.

    Now if I put those three files into their own project in my solution and reference that project with my project, everything compiles great. But when I move the files over to the server, I get an error that tells me that those classes are being duplicated. That makes total sense. I get the same issue if I include the files into my project. Again, makes total sense since there are being used twice.
    So the problem is that my project won't compile without them but won't run on the server with them.

    The question is this, is it possible to tell my project to reference just those files without having to make them their own project? Or can the compiler be told to look at those files and compile their location but not compile the actual file? I don't know much about how the VS compiler works.

    Any ideas would be greatly appreciated. Thanks.
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    In your current production site how are the 3 required classes used. Is there an include file somewhere? Are the dlls references via a com object?

    Nathan

    Comment

    • mgriggs
      New Member
      • Oct 2008
      • 2

      #3
      Well that is what I mean by the site being somewhat of a Frankenstien's monster... it is a combination of asp, vb.net and c#.net. It amazes me everyday that it doesn't just crash and explode.

      .asp files use include directives, .cs and .vb files use partial class inheritence in the codebehind page without compilation i.e.
      Code:
      namespace x
          namspace y
              public partial class c1 : base_class
              ...
              ...
      The problem is that we have been trying to start converting the site over to compiled c#.net (we have years of work ahead of us) and so we are under instruction to create all new projects as compiled c#.net projects. The main problem is that my project is the guniea pig of sorts. And maybe it just can't be done without compiling these base classes into their own dll and using that. However that would cause the same problem because the rest of the site needs the files and will have to be rewritten to access the .dll file.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        I don't know how you're going to end up solving this...

        Since touching these 3 classes could potentially break your entire site have you considered creating a DLL that contains these 3 classes (renamed) that only your .NET code will reference?

        That way when you eventually migrate the rest of the site to .NET you simply point to this new DLL...and you don't have to touch the old classes...


        -Frinny

        Comment

        • nateraaaa
          Recognized Expert Contributor
          • May 2007
          • 664

          #5
          If you create solution with only the 3 required classes to create a dll you could then create a post build event to copy this dll to a specific location. By referencing this location you would not have to worry about other applications having different version of this shared dll. All of your applications that use this dll would point to the same location and inherit any changes make to the 3 classes in this dll.

          Nathan

          Comment

          Working...