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. Web Development
  3. SharePoint
  4. Using Sharepoint Object Model in Visual Studio Windows Service

Using Sharepoint Object Model in Visual Studio Windows Service

Scheduled Pinned Locked Moved SharePoint
helpcsharpsharepointvisual-studio
7 Posts 4 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.
  • M Offline
    M Offline
    mharoonkhan
    wrote on last edited by
    #1

    SPSite osite = new SPSite("http://litwaredemo/Test"); When im trying to acess the following site using sharepoint object model in windows service it give me an an Exception: it give me an exception message: The Web application at http://litwaredemo:80/Test could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. ( but the above statement working fine when i use this statement in console application ) can any one help to resolve this error

    KnightGuy

    N P 2 Replies Last reply
    0
    • M mharoonkhan

      SPSite osite = new SPSite("http://litwaredemo/Test"); When im trying to acess the following site using sharepoint object model in windows service it give me an an Exception: it give me an exception message: The Web application at http://litwaredemo:80/Test could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. ( but the above statement working fine when i use this statement in console application ) can any one help to resolve this error

      KnightGuy

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Not sure in your case but I've seen this happen when the application is compiled as x64.


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      • M mharoonkhan

        SPSite osite = new SPSite("http://litwaredemo/Test"); When im trying to acess the following site using sharepoint object model in windows service it give me an an Exception: it give me an exception message: The Web application at http://litwaredemo:80/Test could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. ( but the above statement working fine when i use this statement in console application ) can any one help to resolve this error

        KnightGuy

        P Offline
        P Offline
        pavan garlapati
        wrote on last edited by
        #3

        I think you have to give like SPSite osite = new SPSite("http://litwaredemo:1234/Test"); Notice that 1234 is the port number.

        N 1 Reply Last reply
        0
        • P pavan garlapati

          I think you have to give like SPSite osite = new SPSite("http://litwaredemo:1234/Test"); Notice that 1234 is the port number.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          I guess you don't know anything about SharePoint. SharePoint is on port 80, the default port for http so there is no need to specify the port, nor would it be anything other than port 80 except for central admin.


          I know the language. I've read a book. - _Madmatt

          P I 2 Replies Last reply
          0
          • N Not Active

            I guess you don't know anything about SharePoint. SharePoint is on port 80, the default port for http so there is no need to specify the port, nor would it be anything other than port 80 except for central admin.


            I know the language. I've read a book. - _Madmatt

            P Offline
            P Offline
            pavan garlapati
            wrote on last edited by
            #5

            I am beginner to sharepoint. I know sharepoint default port is 80. I just given my view only.

            1 Reply Last reply
            0
            • N Not Active

              I guess you don't know anything about SharePoint. SharePoint is on port 80, the default port for http so there is no need to specify the port, nor would it be anything other than port 80 except for central admin.


              I know the language. I've read a book. - _Madmatt

              I Offline
              I Offline
              Ian McCaul
              wrote on last edited by
              #6

              This is not true. SharePoint web applications can be set to use any available port. 80 is the default, but you can create web applications and site collections on different ports as well. When constructing the SPSite object then you need to specify the correct url (with port unless its 80 then you dont need to include the port). The problem I think the user is facing is he is not compiling as 'Any CPU', I have also seen this happen when UAC is turned on and you dont run VS as Admin.

              N 1 Reply Last reply
              0
              • I Ian McCaul

                This is not true. SharePoint web applications can be set to use any available port. 80 is the default, but you can create web applications and site collections on different ports as well. When constructing the SPSite object then you need to specify the correct url (with port unless its 80 then you dont need to include the port). The problem I think the user is facing is he is not compiling as 'Any CPU', I have also seen this happen when UAC is turned on and you dont run VS as Admin.

                N Offline
                N Offline
                Not Active
                wrote on last edited by
                #7

                It holds true 95% of installations and since the OP was using the default setup it also holds true in this situation. There are always exceptions.


                I know the language. I've read a book. - _Madmatt

                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