Jump to content

C# inheritance error


Richard Robertson
 Share

Recommended Posts

I'm getting two errors that I can't understand. I was hoping someone might shed some light on it.

The errors I got are:

Error   1   'Company.VSPackage1.Class1' does not implement inherited abstract member 'Microsoft.VisualStudio.Package.AuthoringScope.Goto(Microsoft.VisualStudio.VSConstants.VSStd97CmdID, Microsoft.VisualStudio.TextManager.Interop.IVsTextView, int, int, out Microsoft.VisualStudio.TextManager.Interop.TextSpan)'   C:\Documents and Settings\Richard\My Documents\Visual Studio 2008\Projects\VSPackage1\VSPackage1\Class1.cs  9   8   VSPackage1

Error   2   'Company.VSPackage1.Class1.Goto(Microsoft.VisualStudio.VSConstants.VSStd97CmdID, Microsoft.VisualStudio.TextManager.Interop.IVsTextView, int, int, out Microsoft.VisualStudio.TextManager.Interop.TextSpan)': no suitable method found to override  C:\Documents and Settings\Richard\My Documents\Visual Studio 2008\Projects\VSPackage1\VSPackage1\Class1.cs  26  26  VSPackage1

I can't, for the life of me, figure out how those two errors happen at the same time.

The entire project is here, in case anyone is interested. It requires the Visual Studio 2008 SDK. http://www.rarobertson.net/VSPackage1.zip

The steps I took were:

Create a new VSPackage project.

Add a reference to Microsoft.VisualStudio.Package.LanguageService.

Add a new class "Class1".

Inherit from Microsoft.VisualStudio.Package.AuthoringScope.

Use intellisense to implement abstract members.

Hit compile.

Link to comment
Share on other sites

Richard,

I don't know about this error yet, but as I am about to get into C# way too deep too quickly, I will try and do what I can when I get home to debug this issue as hopefully it will help me as I move forward. I know it always helps me the more problems I try to work through (so long as I am solving them haha).

I'll see what I can do.

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

It might be that AuthoringScope is not CLS compliant.. Not sure, though.

Edit: Found some (old) code that inherits from AuthoringScope:

http://nemerle.org/mailman/pipermail/svn/2...une/006382.html

Search for: vs-plugin/branches/andreif/NemerleLanguageService/NemerleAuthoringScope.cs

I've tried their code (very similar) and it failed with the same error. I say; Take it to the MSDN forums.

Edited by Manadar
Link to comment
Share on other sites

Aye, and I didn't end up getting any C# time last night... :)

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

I was able to duplicate your issue also. I'm not sure why it's doing that, It could be a bug in the .dll (you might try opening it in Reflector and see if it's declared correctly).

However the problem seems to disappear when I reference the .net 3.5 version of the dll (Microsoft.VisualStudio.Package.LanguageService.9.0) which still uses the v2.0 runtime according to it's signature.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...