Skip to main content
Tweeted twitter.com/#!/StackSharePoint/status/254914648845991936
added 6 characters in body
Source Link
FarOoOosa
  • 398
  • 1
  • 4
  • 13

I'm trying to use SP 2010 site from a web application and when I create a new instance of SPSite I get this error: The Web application at 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. I know that this question is common over the net but I didnt find the solution for me The Code:

  SPSecurity.RunWithElevatedPrivileges(delegate()
        {
            using (SPSite site = new SPSite(SiteCollectionPath"http://servername:port"))
            {
                elevatedWeb = site.OpenWeb();
            }

1.I run my code on sharepoint server its the same machine

2.I copy paste the Url to browser and its work

3.I use .NET 3.5 Framework

4.I have full permission on site for administrator account and also dbowner

5.I used platform target Any CPU my sharepoint is 64 and when Im try to make it 64 i face a problrm with my Dll: "Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format."

Any Suggestion for that big problem

I'm trying to use SP 2010 site from a web application and when I create a new instance of SPSite I get this error: The Web application at 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. I know that this question is common over the net but I didnt find the solution for me The Code:

  SPSecurity.RunWithElevatedPrivileges(delegate()
        {
            using (SPSite site = new SPSite(SiteCollectionPath))
            {
                elevatedWeb = site.OpenWeb();
            }

1.I run my code on sharepoint server its the same machine

2.I copy paste the Url to browser and its work

3.I use .NET 3.5 Framework

4.I have full permission on site for administrator account and also dbowner

5.I used platform target Any CPU my sharepoint is 64 and when Im try to make it 64 i face a problrm with my Dll: "Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format."

Any Suggestion for that big problem

I'm trying to use SP 2010 site from a web application and when I create a new instance of SPSite I get this error: The Web application at 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. I know that this question is common over the net but I didnt find the solution for me The Code:

  SPSecurity.RunWithElevatedPrivileges(delegate()
        {
            using (SPSite site = new SPSite("http://servername:port"))
            {
                elevatedWeb = site.OpenWeb();
            }

1.I run my code on sharepoint server its the same machine

2.I copy paste the Url to browser and its work

3.I use .NET 3.5 Framework

4.I have full permission on site for administrator account and also dbowner

5.I used platform target Any CPU my sharepoint is 64 and when Im try to make it 64 i face a problrm with my Dll: "Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format."

Any Suggestion for that big problem

Source Link
FarOoOosa
  • 398
  • 1
  • 4
  • 13

SPSite - The Web application at <address> could not be found

I'm trying to use SP 2010 site from a web application and when I create a new instance of SPSite I get this error: The Web application at 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. I know that this question is common over the net but I didnt find the solution for me The Code:

  SPSecurity.RunWithElevatedPrivileges(delegate()
        {
            using (SPSite site = new SPSite(SiteCollectionPath))
            {
                elevatedWeb = site.OpenWeb();
            }

1.I run my code on sharepoint server its the same machine

2.I copy paste the Url to browser and its work

3.I use .NET 3.5 Framework

4.I have full permission on site for administrator account and also dbowner

5.I used platform target Any CPU my sharepoint is 64 and when Im try to make it 64 i face a problrm with my Dll: "Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format."

Any Suggestion for that big problem