Wrox Programmer Forums
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2009, 10:09 AM
Authorized User
 
Join Date: Jun 2009
Posts: 66
Thanks: 22
Thanked 0 Times in 0 Posts
Default Compilation error!!

Hello,
....I apologize if this is not the designated area for a post like this.


I have installed APS.NET recently, but my application is developed in an older version. So when ever I start .NET it asks me if I want to convert it to the latest version....and if I click yes then it keeps a back up and finishes the conversion process.....but after the conversion is done my application becomes unusable......I can not load it from browser, it says Compilation error....


Server Error in '/hiv' 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: CS0103: The name 'subItems' does not exist in the current context

Source Error:


Line 68: static public bool HasAccess(int index)
Line 69: {
Line 70: if (subItems[index] != null)
Line 71: {
Line 72: int count = subItems[index].itemsValues.Length;
Source File: c:\inetpub\wwwroot\hiv\App_Code\Migrated\Controls\ Stub_NavSubMenu_ascx_cs.cs Line: 70



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.Web.Service s\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dl l" /R:"C:\Windows\assembly\GAC_32\System.Data\2.0.0.0_ _b77a5c561934e089\System.Data.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0 __b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__ b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Ser ialization.Formatters.Soap\2.0.0.0__b03f5f7f11d50a 3a\System.Runtime.Serialization.Formatters.Soap.dl l" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityMod el\3.0.0.0__b77a5c561934e089\System.IdentityModel. dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowSer vices\3.5.0.0__31bf3856ad364e35\System.WorkflowSer vices.dll" /R:"C:\Windows\assembly\GAC_MSIL\Accessibility\2.0. 0.0__b03f5f7f11d50a3a\Accessibility.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\ 2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\m scorlib.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceMode l\3.0.0.0__b77a5c561934e089\System.ServiceModel.dl l" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Ser ialization\3.0.0.0__b77a5c561934e089\System.Runtim e.Serialization.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configurati on\2.0.0.0__b03f5f7f11d50a3a\System.Configuration. dll" /R:"C:\Windows\assembly\GAC_32\System.EnterpriseSer vices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseS ervices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b7 7a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceMode l.Web\3.5.0.0__31bf3856ad364e35\System.ServiceMode l.Web.dll" /out:"C:\Windows\Microsoft.NET\Framework\v2.0.50727 \Temporary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.dll" /D:DEBUG /debug+ /optimize- /w:0 /nowarn:1659;1699;1701 /d:DEBUG;TRACE "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.6.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.8.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.4.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.15.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.18.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.13.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.2.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.17.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.0.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.16.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.11.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.7.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.9.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.5.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.14.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.12.c s" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.3.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.1.cs " "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\hiv\2ad30e6a\7b936ef1\App_Code.prtzkrx3.10.c s" Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053 for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727 Copyright (C) Microsoft Corporation 2001-2005. All rights reserved. c:\inetpub\wwwroot\hiv\App_Code\Migrated\Controls\ Stub_NavSubMenu_ascx_cs.cs(70,8): error CS0103: The name 'subItems' does not exist in the current context c:\inetpub\wwwroot\hiv\App_Code\Migrated\Controls\ Stub_NavSubMenu_ascx_cs.cs(72,17): error CS0103: The name 'subItems' does not exist in the current context c:\inetpub\wwwroot\hiv\App_Code\Migrated\Controls\ Stub_NavSubMenu_ascx_cs.cs(75,29): error CS0103: The name 'subItems' does not exist in the current context


Show Complete Compilation Source:

Line 1: // Line 2: // This file was generated as part of an ASP.NET 2.0 Web project conversion. Line 3: // This code file 'App_Code\Migrated\Controls\Stub_NavSubMenu_ascx_c s.cs' was created and contains an abstract class Line 4: // used as a base class for the class 'Migrated_NavSubMenu' in file 'Controls\NavSubMenu.ascx.cs'. Line 5: // This allows the the base class to be referenced by all code files in your project. Line 6: // For more information on this code pattern, please refer to http://go.microsoft.com/fwlink/?LinkId=46995 Line 7: // Line 8: Line 9: Line 10: Line 11: namespace HIV.Controls Line 12: { Line 13: Line 14: using System; Line 15: using System.Data; Line 16: using System.Drawing; Line 17: using System.Web; Line 18: using System.Web.UI; Line 19: using System.Web.UI.WebControls; Line 20: using System.Web.UI.HtmlControls; Line 21: Line 22: abstract public class NavSubMenu : System.Web.UI.UserControl Line 23: { Line 24: public enum SubItems Line 25: { Line 26: NONE = -1, Line 27: Line 28: // Query Sub Items Line 29: RUN_QUERY = 0, Line 30: MAX_QUERY, Line 31: Line 32: // Subject Sub Items Line 33: ADD_ENROLLMENT = 0, Line 34: ADD_RESURVEY, Line 35: ADD_NON_RESURVEY, Line 36: FIND_SUBJECT, Line 37: //FIND_APPOINTMENT, Line 38: MAX_SUBJECT, Line 39: Line 40: // Specimen Sub Items Line 41: ADD_SPECIMEN = 0, Line 42: LOCATE_SPECIMEN, Line 43: RETURN_SPECIMEN, Line 44: MAX_SPECIMEN, Line 45: Line 46: // Test Data Sub Items Line 47: ADD_TEST_DATA = 0, Line 48: MAX_TEST_DATA, Line 49: Line 50: // Admin Sub Items Line 51: CHANGE_PASSWORD = 0, Line 52: CONTACT_FORM, Line 53: MANAGE_USERS, Line 54: ACCOUNT_REQUESTS, Line 55: REQUEST_ACCESS, Line 56: MAX_ADMIN Line 57: } Line 58: abstract public NavMenu.MainItems SelectedMainItem Line 59: { Line 60: get; Line 61: set; Line 62: } Line 63: abstract public SubItems SelectedSubItem Line 64: { Line 65: get; Line 66: set; Line 67: } Line 68: static public bool HasAccess(int index) Line 69: { Line 70: if (subItems[index] != null) Line 71: { Line 72: int count = subItems[index].itemsValues.Length; Line 73: for (int i = 0; i < count; i++) Line 74: { Line 75: if (Security.HasAccess(subItems[index].itemsAccessLevel[i])) Line 76: return true; Line 77: } Line 78: Line 79: } Line 80: return false; Line 81: } Line 82: Line 83: Line 84: } Line 85: Line 86: Line 87: Line 88: } Line 89:


Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074


When I converted to the latest version then the following message showed up :
If the solution or project is under source control, it will be checked out automatically during the conversion. Be sure the correct Source Control Plug In is active, and no files are exclusively checked out by other users.

The Upgrade Wizard upgrades projects that target the .NET Compact Framework 1.0 to target the .NET Compact Framework 2.0.
.NET Compact Framework 2.0 applications will remain unchanged.
SQL Server Mobile 3.0 and SQL Server Compact Edition 3.1 references will be upgraded to SQL Server Compact 3.5 reference.
Additionally, managed Smartphone 2003 projects are upgraded to target Windows Mobile 5.0.

Conversion type: In-place with no backup


Solution to be converted: HIV
Projects:
hiv






At this moment I don't understand why this is happening.....I am not even opening the application form c:\inetpub\wwwroot\hiv\...............I was opening it from another location of my hard drive that is not relaed to this .......!!!

Last edited by skhan; June 25th, 2009 at 11:31 AM..
 
Old June 25th, 2009, 11:30 AM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

The error is exactly what it says - the subitems array is not declared in the context of the HasAccess method.

This is a compiler error, so it prevents the application from building the required assembly.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
The Following User Says Thank You to Lee Dumond For This Useful Post:
skhan (June 25th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Microsoft VBScript compilation error '800a0409' webXtreme Classic ASP Basics 4 February 4th, 2009 03:58 AM
Compilation Error darkestangel1980 ASP.NET 2.0 Basics 0 February 4th, 2008 05:46 AM
Compilation Error jotnarta JSP Basics 1 March 23rd, 2007 07:14 AM
Compilation Error allyant ASP.NET 2.0 Basics 1 August 5th, 2006 05:51 PM
compilation error luizou Classic ASP Components 1 February 10th, 2005 06:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.