I have an ASP.net project that works fine.
I copied it to another project using the following steps:
<<
(i) create a new VS.NET ASP.NET project.
(ii) copy all the files from the old wwwroot subfolder to the new one
(iii) include all those files into the project
(iv) add a reference or two that didn't get copied over in (iii)
(v) build it - it builds ok
What happens when I take some page of the new project and try to 'view in
browser' I get:
<<
Server Error in '/MyWebInterface_ NexusDB' Application.
----------------------------------------------------------------------------
----
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: CS1595: 'MyWebInterface .Secure.MyHeade r' is defined
in multiple places; using definition from
'e:\WINNT\Micro soft.NET\Framew ork\v1.1.4322\T emporary ASP.NET
Files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\assembly\dl2\ 24513897\d2fa73 4
0_58f7c301\MyWe bInterface_Nexu sDB.DLL'
Source Error:
Line 27:
Line 28:
[System.Runtime. CompilerService s.CompilerGloba lScopeAttribute ()]
Line 29: public class MyHeader_ascx : MyWebInterface. Secure.MyHeader {
Line 30:
Line 31: private static bool __initialized = false;
Source File: e:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\Te mporary ASP.NET
Files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\ucrrz4fp.0.cs Line: 29
As far as I can work out (the source file info at the end tells me nothing!)
it is complaining about a header user control I made, which of course is
referred to in multiple places (pretty much every page), but I've got no
idea
why it's complaining about it or even in which file the complaint is being
generated (on line 29 of that file).
The detailed compiler output is
<<
E:\WINNT\system 32> "e:\winnt\micro soft.net\framew ork\v1.1.4322\c sc.exe"
/t:library /utf8output
/R:"e:\winnt\mic rosoft.net\fram ework\v1.1.4322 \temporary asp.net
files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\assembly\dl2\ 464084f2\32fdf8 b
5_8293c301\Mywe binterface.dll"
/R:"e:\winnt\ass embly\gac\syste m.web\1.0.5000. 0__b03f5f7f11d5 0a3a\system.web
..dll"
/R:"e:\winnt\ass embly\gac\syste m\1.0.5000.0__b 77a5c561934e089 \system.dll"
/R:"e:\winnt\ass embly\gac\syste m.web.services\ 1.0.5000.0__b03 f5f7f11d50a3a\s
ystem.web.servi ces.dll"
/R:"e:\winnt\ass embly\gac\syste m.xml\1.0.5000. 0__b77a5c561934 e089\system.xml
..dll"
/R:"e:\winnt\ass embly\gac\syste m.drawing\1.0.5 000.0__b03f5f7f 11d50a3a\system
..drawing.dll"
/R:"e:\winnt\ass embly\gac\syste m.web.mobile\1. 0.5000.0__b03f5 f7f11d50a3a\sys
tem.web.mobile. dll" /R:"e:\winnt\mic rosoft.net\fram ework\v1.1.4322 \temporary
asp.net
files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\assembly\dl2\ 24513897\9efd1a 9
9_42f8c301\Mywe binterface_nexu sdb.dll"
/R:"e:\winnt\ass embly\gac\syste m.data\1.0.5000 .0__b77a5c56193 4e089\system.da
ta.dll"
/R:"e:\winnt\ass embly\gac\syste m.enterpriseser vices\1.0.5000. 0__b03f5f7f11d5
0a3a\system.ent erpriseservices .dll"
/R:"e:\winnt\mic rosoft.net\fram ework\v1.1.4322 \mscorlib.dll"
/R:"e:\winnt\mic rosoft.net\fram ework\v1.1.4322 \temporary asp.net
files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\9xqkxlsx.dll"
/out:"E:\WINNT\M icrosoft.NET\Fr amework\v1.1.43 22\Temporary ASP.NET
Files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\9cswzlnb.dll" /D:DEBUG
/debug+ /optimize- /warnaserror /w:1
"E:\WINNT\Micro soft.NET\Framew ork\v1.1.4322\T emporary ASP.NET
Files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\9cswzlnb.0.cs "
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
e:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\Te mporary ASP.NET
Files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\9cswzlnb.0.cs (29,39): error
CS1595: 'MyWebInterface .Secure.MyHeade r' is defined in multiple places;
using definition from 'e:\WINNT\Micro soft.NET\Framew ork\v1.1.4322\T emporary
ASP.NET
Files\Mywebinte rface_nexusdb\f e7356c1\5423ab6 1\assembly\dl2\ 464084f2\32fdf8 b
5_8293c301\MyWe bInterface.DLL'
The complete compilation source is
<<
Line 1:
//--------------------------------------------------------------------------
----
Line 2: // <autogenerate d>
Line 3: // This code was generated by a tool.
Line 4: // Runtime Version: 1.1.4322.573
Line 5: //
Line 6: // Changes to this file may cause incorrect behavior and will
be lost if
Line 7: // the code is regenerated.
Line 8: // </autogenerated>
Line 9:
//--------------------------------------------------------------------------
----
Line 10:
Line 11: namespace ASP {
Line 12: using System;
Line 13: using System.Collecti ons;
Line 14: using System.Collecti ons.Specialized ;
Line 15: using System.Configur ation;
Line 16: using System.Text;
Line 17: using System.Text.Reg ularExpressions ;
Line 18: using System.Web;
Line 19: using System.Web.Cach ing;
Line 20: using System.Web.Sess ionState;
Line 21: using System.Web.Secu rity;
Line 22: using System.Web.UI;
Line 23: using System.Web.UI.W ebControls;
Line 24: using System.Web.UI.H tmlControls;
Line 25: using ASP;
Line 26:
Line 27:
Line 28:
[System.Runtime. CompilerService s.CompilerGloba lScopeAttribute ()]
Line 29: public class MyHeader_ascx : MyWebInterface. Secure.MyHeader {
Line 30:
Line 31: private static bool __initialized = false;
Line 32:
Line 33: public MyHeader_ascx() {
Line 34: if ((ASP.MyHeader_ ascx.__initiali zed == false)) {
Line 35: ASP.MyHeader_as cx.__initialize d = true;
Line 36: }
Line 37: }
Line 38:
Line 39: protected override bool SupportAutoEven ts {
Line 40: get {
Line 41: return false;
Line 42: }
Line 43: }
Line 44:
Line 45: protected ASP.Global_asax ApplicationInst ance {
Line 46: get {
Line 47: return
((ASP.Global_as ax)(this.Contex t.ApplicationIn stance));
Line 48: }
Line 49: }
Line 50:
Line 51: public override string TemplateSourceD irectory {
Line 52: get {
Line 53: return "/MyWebInterface_ NexusDB";
Line 54: }
Line 55: }
Line 56:
Line 57: private System.Web.UI.C ontrol __BuildControll bHome() {
Line 58: System.Web.UI.W ebControls.Link Button __ctrl;
Line 59:
Line 60: #line 4
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 61: __ctrl = new System.Web.UI.W ebControls.Link Button();
Line 62:
Line 63: #line default
Line 64: #line hidden
Line 65: this.lbHome = __ctrl;
Line 66:
Line 67: #line 4
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 68: __ctrl.ID = "lbHome";
Line 69:
Line 70: #line default
Line 71: #line hidden
Line 72: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 73:
Line 74: #line 4
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 75: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" Home"));
Line 76:
Line 77: #line default
Line 78: #line hidden
Line 79: return __ctrl;
Line 80: }
Line 81:
Line 82: private System.Web.UI.C ontrol __BuildControlh linkPublic()
{
Line 83: System.Web.UI.W ebControls.Hype rLink __ctrl;
Line 84:
Line 85: #line 5
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 86: __ctrl = new System.Web.UI.W ebControls.Hype rLink();
Line 87:
Line 88: #line default
Line 89: #line hidden
Line 90: this.hlinkPubli c = __ctrl;
Line 91:
Line 92: #line 5
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 93: __ctrl.ID = "hlinkPubli c";
Line 94:
Line 95: #line default
Line 96: #line hidden
Line 97:
Line 98: #line 5
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 99: __ctrl.Navigate Url = "~/public/PublicMain.aspx ";
Line 100:
Line 101: #line default
Line 102: #line hidden
Line 103: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 104:
Line 105: #line 5
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 106: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" Public"));
Line 107:
Line 108: #line default
Line 109: #line hidden
Line 110: return __ctrl;
Line 111: }
Line 112:
Line 113: private System.Web.UI.C ontrol __BuildControlh refSecure()
{
Line 114: System.Web.UI.H tmlControls.Htm lAnchor __ctrl;
Line 115:
Line 116: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 117: __ctrl = new System.Web.UI.H tmlControls.Htm lAnchor();
Line 118:
Line 119: #line default
Line 120: #line hidden
Line 121: this.hrefSecure = __ctrl;
Line 122:
Line 123: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 124: __ctrl.ID = "hrefSecure ";
Line 125:
Line 126: #line default
Line 127: #line hidden
Line 128:
Line 129: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 130: __ctrl.HRef = "~/Secure/Main.aspx";
Line 131:
Line 132: #line default
Line 133: #line hidden
Line 134: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 135:
Line 136: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 137: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" \r\n\t\t\tSecur e"));
Line 138:
Line 139: #line default
Line 140: #line hidden
Line 141: return __ctrl;
Line 142: }
Line 143:
Line 144: private System.Web.UI.C ontrol __BuildControls pnSecure() {
Line 145: System.Web.UI.H tmlControls.Htm lGenericControl __ctrl;
Line 146:
Line 147: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 148: __ctrl = new
System.Web.UI.H tmlControls.Htm lGenericControl ("span");
Line 149:
Line 150: #line default
Line 151: #line hidden
Line 152: this.spnSecure = __ctrl;
Line 153:
Line 154: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 155: __ctrl.ID = "spnSecure" ;
Line 156:
Line 157: #line default
Line 158: #line hidden
Line 159:
Line 160: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 161: this.__BuildCon trolhrefSecure( );
Line 162:
Line 163: #line default
Line 164: #line hidden
Line 165: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 166:
Line 167: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 168: __parser.AddPar sedSubObject(th is.hrefSecure);
Line 169:
Line 170: #line default
Line 171: #line hidden
Line 172:
Line 173: #line 6
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 174: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" |&n bsp; "));
Line 175:
Line 176: #line default
Line 177: #line hidden
Line 178: return __ctrl;
Line 179: }
Line 180:
Line 181: private System.Web.UI.C ontrol __BuildControlh refAdmin() {
Line 182: System.Web.UI.H tmlControls.Htm lAnchor __ctrl;
Line 183:
Line 184: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 185: __ctrl = new System.Web.UI.H tmlControls.Htm lAnchor();
Line 186:
Line 187: #line default
Line 188: #line hidden
Line 189: this.hrefAdmin = __ctrl;
Line 190:
Line 191: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 192: __ctrl.ID = "hrefAdmin" ;
Line 193:
Line 194: #line default
Line 195: #line hidden
Line 196:
Line 197: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 198: __ctrl.HRef = "~/Secure/Admin/AdminMain.aspx" ;
Line 199:
Line 200: #line default
Line 201: #line hidden
Line 202: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 203:
Line 204: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 205: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" \r\n\t\t\tAdmin "));
Line 206:
Line 207: #line default
Line 208: #line hidden
Line 209: return __ctrl;
Line 210: }
Line 211:
Line 212: private System.Web.UI.C ontrol __BuildControls pnAdmin() {
Line 213: System.Web.UI.H tmlControls.Htm lGenericControl __ctrl;
Line 214:
Line 215: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 216: __ctrl = new
System.Web.UI.H tmlControls.Htm lGenericControl ("span");
Line 217:
Line 218: #line default
Line 219: #line hidden
Line 220: this.spnAdmin = __ctrl;
Line 221:
Line 222: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 223: __ctrl.ID = "spnAdmin";
Line 224:
Line 225: #line default
Line 226: #line hidden
Line 227:
Line 228: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 229: this.__BuildCon trolhrefAdmin() ;
Line 230:
Line 231: #line default
Line 232: #line hidden
Line 233: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 234:
Line 235: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 236: __parser.AddPar sedSubObject(th is.hrefAdmin);
Line 237:
Line 238: #line default
Line 239: #line hidden
Line 240:
Line 241: #line 8
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 242: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" |&n bsp; "));
Line 243:
Line 244: #line default
Line 245: #line hidden
Line 246: return __ctrl;
Line 247: }
Line 248:
Line 249: private System.Web.UI.C ontrol __BuildControll bLogOut() {
Line 250: System.Web.UI.W ebControls.Link Button __ctrl;
Line 251:
Line 252: #line 10
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 253: __ctrl = new System.Web.UI.W ebControls.Link Button();
Line 254:
Line 255: #line default
Line 256: #line hidden
Line 257: this.lbLogOut = __ctrl;
Line 258:
Line 259: #line 10
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 260: __ctrl.ID = "lbLogOut";
Line 261:
Line 262: #line default
Line 263: #line hidden
Line 264: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 265:
Line 266: #line 10
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 267: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" Log Out"));
Line 268:
Line 269: #line default
Line 270: #line hidden
Line 271: return __ctrl;
Line 272: }
Line 273:
Line 274: private System.Web.UI.C ontrol __BuildControll blURL() {
Line 275: System.Web.UI.W ebControls.Labe l __ctrl;
Line 276:
Line 277: #line 11
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 278: __ctrl = new System.Web.UI.W ebControls.Labe l();
Line 279:
Line 280: #line default
Line 281: #line hidden
Line 282: this.lblURL = __ctrl;
Line 283:
Line 284: #line 11
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 285: __ctrl.ID = "lblURL";
Line 286:
Line 287: #line default
Line 288: #line hidden
Line 289: return __ctrl;
Line 290: }
Line 291:
Line 292: private void __BuildControlT ree(System.Web. UI.Control
__ctrl) {
Line 293: System.Web.UI.I ParserAccessor __parser =
((System.Web.UI .IParserAccesso r)(__ctrl));
Line 294:
Line 295: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 296: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" \r\n<H2 align=\"center\ "><font
color=\"darkred \">My Regional Data Integration Onli" +
Line 297: "ne</font>\r\n</H2>\r\n<P align=\"center\ ">"));
Line 298:
Line 299: #line default
Line 300: #line hidden
Line 301:
Line 302: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 303: this.__BuildCon trollbHome();
Line 304:
Line 305: #line default
Line 306: #line hidden
Line 307:
Line 308: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 309: __parser.AddPar sedSubObject(th is.lbHome);
Line 310:
Line 311: #line default
Line 312: #line hidden
Line 313:
Line 314: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 315: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" |&n bsp; \r\n\ t"));
Line 316:
Line 317: #line default
Line 318: #line hidden
Line 319:
Line 320: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 321: this.__BuildCon trolhlinkPublic ();
Line 322:
Line 323: #line default
Line 324: #line hidden
Line 325:
Line 326: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 327: __parser.AddPar sedSubObject(th is.hlinkPublic) ;
Line 328:
Line 329: #line default
Line 330: #line hidden
Line 331:
Line 332: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 333: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" |&n bsp; \r\n\ t"));
Line 334:
Line 335: #line default
Line 336: #line hidden
Line 337:
Line 338: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 339: this.__BuildCon trolspnSecure() ;
Line 340:
Line 341: #line default
Line 342: #line hidden
Line 343:
Line 344: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 345: __parser.AddPar sedSubObject(th is.spnSecure);
Line 346:
Line 347: #line default
Line 348: #line hidden
Line 349:
Line 350: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 351: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" \r\n\t"));
Line 352:
Line 353: #line default
Line 354: #line hidden
Line 355:
Line 356: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 357: this.__BuildCon trolspnAdmin();
Line 358:
Line 359: #line default
Line 360: #line hidden
Line 361:
Line 362: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 363: __parser.AddPar sedSubObject(th is.spnAdmin);
Line 364:
Line 365: #line default
Line 366: #line hidden
Line 367:
Line 368: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 369: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" \r\n\t"));
Line 370:
Line 371: #line default
Line 372: #line hidden
Line 373:
Line 374: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 375: this.__BuildCon trollbLogOut();
Line 376:
Line 377: #line default
Line 378: #line hidden
Line 379:
Line 380: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 381: __parser.AddPar sedSubObject(th is.lbLogOut);
Line 382:
Line 383: #line default
Line 384: #line hidden
Line 385:
Line 386: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 387: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" \r\n\t")) ;
Line 388:
Line 389: #line default
Line 390: #line hidden
Line 391:
Line 392: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 393: this.__BuildCon trollblURL();
Line 394:
Line 395: #line default
Line 396: #line hidden
Line 397:
Line 398: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 399: __parser.AddPar sedSubObject(th is.lblURL);
Line 400:
Line 401: #line default
Line 402: #line hidden
Line 403:
Line 404: #line 1
"e:\inetpub\www root\MyWebInter face_NexusDB\My Header.ascx"
Line 405: __parser.AddPar sedSubObject(ne w
System.Web.UI.L iteralControl(" </P>\r\n<H2>\r\n\ t<HR width=\"100%\"
SIZE=\"1\">\r\n </H2>\r\n"));
Line 406:
Line 407: #line default
Line 408: #line hidden
Line 409: }
Line 410:
Line 411: protected override void FrameworkInitia lize() {
Line 412: this.__BuildCon trolTree(this);
Line 413: }
Line 414: }
Line 415: }
Line 416:
Any suggestions on what is going wrong here? It works in the original, but
not in the copy.
Thanks!
Lauchlan M