Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. The modifier 'public' is not valid for this item.

The modifier 'public' is not valid for this item.

Scheduled Pinned Locked Moved C#
helpcsharptoolsquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steffw
    wrote on last edited by
    #1

    Hello, I'm working on a report loader and I'm facing a little problem. I get this error: The modifier 'public' is not valid for this item. The code is for making the credentials for viewing the report and is originally from a VB script. I've converted it with a lame online converter but I only get one and the same error at every This is one of the methods: namespace Reports { public class ReportServerConnection : IReportServerConnection { public bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } } Anyone an idea? Thanku!

    Stef

    O 1 Reply Last reply
    0
    • S steffw

      Hello, I'm working on a report loader and I'm facing a little problem. I get this error: The modifier 'public' is not valid for this item. The code is for making the credentials for viewing the report and is originally from a VB script. I've converted it with a lame online converter but I only get one and the same error at every This is one of the methods: namespace Reports { public class ReportServerConnection : IReportServerConnection { public bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } } Anyone an idea? Thanku!

      Stef

      O Offline
      O Offline
      originSH
      wrote on last edited by
      #2

      When explicitly implimenting an interface method you can't specify an access modifier as its always going to be public. Remove the public from the method and it'll work fine.

      S 1 Reply Last reply
      0
      • O originSH

        When explicitly implimenting an interface method you can't specify an access modifier as its always going to be public. Remove the public from the method and it'll work fine.

        S Offline
        S Offline
        steffw
        wrote on last edited by
        #3

        Thank you that worked out fine :) But now i'm getting a second error :( namespace Reports { [Serializable()] public abstract class ReportServerConnection : IReportServerConnection { // the error comes here bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } } the error is : 'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials' in explicit interface declaration is not a member of interface and the second is: 'Reports.ReportServerConnection' does not implement interface member 'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(out System.Net.Cookie, out string, out string, out string)' any ideas? Thanku!!

        Stef

        G 1 Reply Last reply
        0
        • S steffw

          Thank you that worked out fine :) But now i'm getting a second error :( namespace Reports { [Serializable()] public abstract class ReportServerConnection : IReportServerConnection { // the error comes here bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } } the error is : 'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials' in explicit interface declaration is not a member of interface and the second is: 'Reports.ReportServerConnection' does not implement interface member 'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(out System.Net.Cookie, out string, out string, out string)' any ideas? Thanku!!

          Stef

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          If you change out to ref, the signature of the method changes. That means that you are trying to implement an overload of the method that does not exist.

          --- single minded; short sighted; long gone;

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups