PDA

View Full Version : Error: 'IRequiresSessionState' is already implemented


Joakim Gran
05-30-2005, 02:41 PM
Hello,

I get this error when compiling Visual Basic.NET aspx-files.

Compiler Error Message: BC31034: Interface 'System.Web.SessionState.IRequiresSessionState' is already implemented by base class 'Spring.Web.UI.Page'.

Seems like the VB compiler is picky about interfaces being implemented several times in the class hiarchy.

The C# compiler doesn't mind at all..

/Joakim



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: BC31034: Interface 'System.Web.SessionState.IRequiresSessionState' is already implemented by base class 'Spring.Web.UI.Page'.

Source Error:


Line 34: Public Class Master_aspx
Line 35: Inherits VBTestApp.eKPI.AppPortal.WebUI.Master
Line 36: Implements System.Web.SessionState.IRequiresSessionState
Line 37:
Line 38:


Source File: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\VBTestAppkpi\0197c897\3ee9e8cf\iwbf5wol.0.vb Line: 36



Show Detailed Compiler Output:

C:\WINDOWS\system32> "c:\windows\microsoft.net\framework\v1.1.4322\vbc.e xe" /t:library /utf8output /R:"c:\windows\assembly\gac\system.web.mobile\1.0.5000 .0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\windows\assembly\gac\system.data\1.0.5000.0__b7 7a5c561934e089\system.data.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ d36939d8\ac7768f0_1065c501\VBTestApp.ekpi.web.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ 28765bd8\76680383_1221c501\aknet.web.dll" /R:"c:\windows\assembly\gac\system.enterpriseservices\ 1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseserv ices.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ 29056550\4c78c0e3_1565c501\VBTestApp.ekpi.appporta l.webui.dll" /R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__b77 a5c561934e089\system.xml.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ 250f9263\109868f8_1565c501\VBTestApp.ekpi.appporta l.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ 7c8d5b04\6e2b3236_1365c501\spring.core.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ 940b4220\d4b525f0_1065c501\VBTestApp.ekpi.core.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ 3a998120\7043803c_1365c501\spring.web.dll" /R:"c:\windows\assembly\gac\system.drawing\1.0.5000.0_ _b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\ksshsurx.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\mlwbqu3a.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\ebz1kxys.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\ejdskt2n.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\zg0miade.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\iivgdg3w.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\vvd-jslu.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\7fszb4f2.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\r7g06qkr.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\mvwxww3t.dll" /R:"c:\windows\assembly\gac\system.web\1.0.5000.0__b03 f5f7f11d50a3a\system.web.dll" /R:"c:\windows\assembly\gac\system\1.0.5000.0__b77a5c5 61934e089\system.dll" /R:"c:\windows\assembly\gac\system.web.services\1.0.50 00.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\tempo rary asp.net files\VBTestAppkpi\0197c897\3ee9e8cf\assembly\dl2\ 540333f0\001db066_832dc401\log4net.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\VBTestAppkpi\0197c897\3ee9e8cf\iwbf5wol.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\VBTestAppkpi\0197c897\3ee9e8cf\iwbf5wol.res" "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\VBTestAppkpi\0197c897\3ee9e8cf\iwbf5wol.0.vb"


Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\VBTestAppkpi\0197c897\3ee9e8cf\iwbf5wol.0.vb (36) : error BC31034: Interface 'System.Web.SessionState.IRequiresSessionState' is already implemented by base class 'Spring.Web.UI.Page'.

Implements System.Web.SessionState.IRequiresSessionState
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





Show Complete Compilation Source:

Line 1: '------------------------------------------------------------------------------
Line 2: ' <autogenerated>
Line 3: ' This code was generated by a tool.
Line 4: ' Runtime Version: 1.1.4322.2032
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: Option Strict Off
Line 12: Option Explicit On
Line 13:
Line 14: Imports ASP
Line 15: Imports Microsoft.VisualBasic
Line 16: Imports Spring.Web.UI.Controls
Line 17: Imports System
Line 18: Imports System.Collections
Line 19: Imports System.Collections.Specialized
Line 20: Imports System.Configuration
Line 21: Imports System.Text
Line 22: Imports System.Text.RegularExpressions
Line 23: Imports System.Web
Line 24: Imports System.Web.Caching
Line 25: Imports System.Web.Security
Line 26: Imports System.Web.SessionState
Line 27: Imports System.Web.UI
Line 28: Imports System.Web.UI.HtmlControls
Line 29: Imports System.Web.UI.WebControls
Line 30:
Line 31: Namespace ASP
Line 32:
Line 33: <System.Runtime.CompilerServices.CompilerGlobalScop eAttribute()> _
Line 34: Public Class Master_aspx
Line 35: Inherits VBTestApp.eKPI.AppPortal.WebUI.Master
Line 36: Implements System.Web.SessionState.IRequiresSessionState
Line 37:
Line 38:
Line 39: #ExternalSource("http://localhost/VBTestAppKPI/PageTemplates/Master.aspx",15)
Line 40: Protected ucPageTitle As ASP.PageTitle_ascx

...

Aleks Seovic
06-03-2005, 09:46 PM
This is very strange error indeed. I'm not sure why VB compiler should care about the fact that interface (especially marker interface) is already implemented, but it looks like it does.

I can remove IRequiresSessionState from our Page class, but that leaves the door open for broken pages, as some of the Spring.Web features require HTTP session.

Probably the best approach is to remove dependency on the session by allowing pluggable strategies to be used for things that require session, such as user locale storage. Technically, user locale could be stored in a cookie, so we could remove session dependency by abstracting user locale storage as IUserLocalStorage and implementing SessionUserLocaleStorage and CookieUserLocaleStorage that users could configure as they want.

This will require some work, I'll keep you posted on the progress.

Regards,

Aleks

Mark Pollack
06-09-2005, 05:28 PM
Hi,

The log4net nant build script compiles the source code in most of the popular clr languages - probably for this reason. In addition to the suggestion above we could add similar functionality to our build script to keep this type of issue in check.

- Mark

Aleks Seovic
06-09-2005, 05:32 PM
I'm not sure that would solve the problem. Issue is not in Spring.Web codebase, but in the compliation of VB.Net pages that are generated by VS.Net and explicitly implement same interface as Spring Page class.

I'm also not sure how we can compile our code with any compiler other than C# compiler!?

- Aleks