Error While creating SPSite instance with SharePoint Foundation 2010 - sharepoint

I'm getting the following error while trying to create a SPSite instance (not open it, just create it):
"The Web application at <URL> 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 have SharePoint Foundation 2010 installed on x64 Windows 7 laptop and VS 2008. I've done a lot of searching the last couple of days and I've tried any suggestion there is:
Setting user permissions to the database.
Targeting the application for x64 CPU.
Running my app with the sharepoint app pool account. Creating new app pool.
Creating windows forms and console applications to run the code from there.
Adding and removing the web application administrators.
Checked the logs (nothing in there).
Writing the URL in full, with machine name and with IP.
The funny thing is that the same code was working fine at one point and then just stopped. I cannot recall to have done anything special to damage it.
Any help will be much appreciated.
Regards,
Martin

To answer my own question the sharepoint site had to be on the default port - 80. Publishing it on any other port and trying to access it by putting the port in the URL did not work. Strange but it worked.

Related

office web apps server 2013 - Got an server error when open /op/generate.aspx

I set up an office web apps server 2013 in windows server 2012 R2, it is good to open this link http://localhost/hosting/discovery, means the office web apss server 2013 is running well.
But when I tried to open this link http://localhost/op/generate.aspx, it gives an error : A big red X, server error sorry for the mistake. We have recorded an error for the server administrator.
I was looking for some blogs, somesay that is causing by logging in the website with the system account, but I dont know what is the system account, and is that logging means the iis service?
I am not use WOPI and sharepoint, what I want is only use office web apps server 2013 to provide view & edit doc and docx files in browser.
Please help, thanks!
PS. If the question not meet the requirement, comment it, I will edit it.
eidt 1 :
I had solve this problem, I had installed AD and OWA in one server.
Install them in different server will ok.
But there is another problem :
When open a word file, It gave an alert:
Microsoft Word Web App
sorry, some problem had appeared, cant open this file.
How to fix this ...
update :
I finally solved it by changing another server to install OWA.
If you want to be able to open documents from UNC paths then run the following command in the PowerShell on your OOS/OWA machine.
Set-OfficeWebAppsFarm -OpenFromURLEnabled
If you need to connect your OOS/OWA to a WOPI host (SharePoint or a custom host) then http://localhost/hosting/discovery is a good enough indication that the instance works fine.

Sharepoint 2013 Apps - Inconsistent error behavior with AppRedirect.aspx

As described in the title, the app simply stops working after some time.
The application itself is a simple, one page form that pulls data from a webapi on another webserver by use of the Sharepoint WebProxy and displays that data using knockout.js. The environment and the Sharepoint Server (On-Premise, same domain as my Dev Machine) are configured correctly - supposedly - as described in
Configure an environment for apps for SharePoint (SharePoint 2013)
I can develop, debug in VS, deploy and open the App directly on the Sharepoint Site.
But after a while, when opening the app again without having changed or redeployed anything it stops at this point in the redirect process:
https://sharepointurl/_layouts/15/appredirect.aspx?instance_id=<some-guid>
and shows the "This page cannot be displayed" message. The Sharepoint Site still works.
There are no errors in the eventlog. Most of the time I can fix this by restarting the IIS service completely on which the Sharepoint Site resides. But sometimes even that doesnt work.
What could be the problem? Any Idea?
Update: The error is not consistent in that it may occur for user A but not for user B and even that can exchange after some time, so that the user B sees the error and user A can use the App.
Update: The error only occurs in IE 11 and doesn't happen when using Google Chrome.
Update: It seems as if Sharepoint 2013 Apps do not work with Internet Explorer 11, which I was using. As we had other issues with IE 11 and Reporting I downgraded my development machine to IE 10 and now it works.
Update: This had nothing to do with IE 11 either. The error eventually returned.
My first recommendation would be to have your client use the 32-bit version of Internet Explorer, even on a Windows 7 64-bit Operating System. Internet Explorer is the ideal browser for Active X and the preferred browser for SharePoint Online for Office 365.
Next I would recommend that your client configure Internet Explorer for SharePoint Online, to review the article detailing this process click here.
My last recommendation would be to have them install the latest updates and configure their computers for use with Office 365. The following links and instructions will detail that process.

making new web application in sharepoint foundation 2013

I have made a new web application on sharepoint foundation 2013 using the steps mentioned in link below.But when i try to access it using both server and client i get the message "401 UNAUTHORIZED".what to do?
http://sharepointgeorge.com/2012/create-web-application-site-collection-sharepoint-2013-preview/
I made it on a client pc having rights of administrator.I have tried quite a few thing by changing iis settings but this problem is not getting solved.Any help would be greatly appreciated.
Do you have kerberos enabled in this environment? If it's not configured correctly, this behavior can happen. You might check your logs to see if there is any additional information.

SharePoint development nightmares

I thought I'd give SharePoint development a go, to broaden my understanding of Microsoft technologies and ran into a situation I refuse to understand.
I have a new web application created: http://localhost:11523 and set up the site collection as required. I can browse to the web site fine, without any issues, but now I want to start developing against this, using the object model.
Right, so after I struggled with SPSite site = new SPSite("http://localhost:11523"); I figured that I'm not running VS2008 in elevated permissions, so restarting VS I finally got one step further.
Whenever I step into my code, I get:
The Web application at
http://localhost:11523/ could not be
found.
I've Googled this without luck. The application is most definitely there, I can browse it, add web parts and go mad. I just can't seem to connect to it via Visual Studio.
Any ideas would be great.
EDIT
I thought I'd isolate my method, called "GetListFromSharePoint(string name)" into a test method (nUnit Framework) and to my surprise returned 9 entries from the list, as expected. When I dumped the method back into my web application (not SharePoint, trying to test the Composite Control through a normal Web site), and run into the mentioned problem.
This is in SharePoint 2007, and I'm developing on the same machine onto which SharePoint 2007 is installed.
This approach used to work, for some reason, I just can't get it to recognize SharePoint. The test stubs work find, just not the web application.
Edit 2
So there where a couple of things I "missed", which kind of solved the problem by itself.
Firstly, I was developing on a x64 Windows 2008 box, thus SharePoint 2007 was running in x64 mode. Cassini, turns out, is 32bit regardless of the platform you run it on, which caused some compiler bugs (I did not have IA64 compilers installed). After installing this, I figured out that the default web site (localhost:80) had been disabled by SharePoint.
Renabling the default web site, allowed me to create my web application as a virtual directory against it, which allowed my debugger compiler to run in x64.
My next challenge was access permissions. Because any new virtual directory on port 80 is assigned to the default application pool, is it assumed that the user does not have the right permissions, so I had to change my web application to run under my SharePoint web application's application pool.
The last thing I had to do was run my SharePoint code with elevated permissions.
Working like a charm :D
Note! Enable debug on your SharePoint web application....
Thanks,
Eric
(You have not specified version - assuming SharePoint 2010).
You need to decide what object model you want to use:
client (to be able to access the server from any other machine)
server (the one that you are trying now, can only be run locally).
Most likley reasons your code not work:
using "localhost" instead of ""computer name" in the Url. (I believe it is the reason.)
you are running your code not on the same machine as the SharePoint
you are running code under non-admin account
Check out how sites collections are configured in "Central Administration" site - urls associated with each site collection are listed there - make sure you are using correct one.
You can also try enumerating all site collections in SPWebApplication (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebapplication.sites.aspx) to start expiriments.
I dont think the SPSite connect through the IIS, and if SharePoint isn't set up to respond to localhost (done in the Central Administration) you wont be able to connect to that url. IIS works a bit different here since it relays the signals to "localhost" to the "web application instance".
Start by checking in your SharePoint Central Administration. Go to "Configure alternate access mappings" in the "System Settings" section. Here you have your SharePoint instances, there are three properties which you can see directly in the list; 'Internal URL', 'Zone' and 'Public URL for Zone'.
If the Internal URL isn't set to Localhost you wont be able to use that connection you suggested. It bay be improper to change this to another url as well, so simply try to set your SPSite site = new SPSite("http://yourinternalurl:11523"); to whatever's in that box! :)
Cheers

IIS ASP with OpenOffice - ActiveX Component Can't Create Object

I have an old website developed in classic ASP, I need to add openoffice functionality in it, so I have created a DLL using UNO services of OpenOffice in VB. I have tried that DLL from locally using in another EXE project and even on command line project.
The problem starts when I use that DLL to ASP. It says 'ActiveX Component Can't Create Object', I have searched a lot and finally I decided to ask some experts regarding this issue. As from my searches it says there is some issue with IIS security. I need to configure some directories with some particular user rights and some DCOM service configuration, seriously I don't know anything about setting user rights to IIS and setting DCOM Services rights, below are URL that points to that issue.
http://www.oooforum.org/forum/viewtopic.phtml?t=24400&highlight=activex+component
http://www.oooforum.org/forum/viewtopic.phtml?t=73470
http://www.oooforum.org/forum/viewtopic.phtml?t=26366
I think there is not such Step-By-Step post available who can direct openoffice users to configure with IIS and ASP.
Please Help, as its and urgent issue.
Thanking You,
Regards,
Verify if the App Pool assigned to your site or virtual directory has the "Enable 32 Bits Applications" parameter in True. Setting it to True was the solution to a similar problem a was facing some time ago.
Finally i found the answer by my self.
I have created a service in windows that calls star office document with administrative privileges.

Resources