Error when trying to deploy webpart - sharepoint

I've been searching on Google for a resolution to this problem, but cannot find one that matches yet.
I'm trying to deploy a simple "Hello World" web part to SharePoint using Visual Studios 2010.
I'm getting an error when I hit F5: "Error occurred in deployment step 'Retract Solution': Cannot connect to the SharePoint site: http://example.com/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project."
Ok, I have done a lot of searching and I'll tell you what I've tried so far. I have full admin rights on the farm, full rights to both databases. I made sure the webpart URL property matches the site property listed in Central Admin as well.
If anyone has any advice or insight it would be greatly appreciated. Thank you in advance.
P.S. (Edit) Also, the farm I'm deploying to and visual studio are on the same machine? would that cause it?

Check the properties of your project in Visual Studio. Click on project node in solution explorer and press F4, then check there 'Site URL' property. It should contains one of the following
http://[your machine name][:port]/[site collection or web relative URL]
http://localhost[:port]/[site collection or web relative URL]
http://[your machine IP address][:port]/[site collection or web relative URL]
Note that Visual Studio must be installed on that machine which is your Web Front End or Application server.
If you got some errors with solution retracting try first deactivate and delete it via Central Admin. Then try to make some deploy-retract checking cycle in Visual Studio. If you still would get errors please post here the log from Visual Studio Output window (Ctrl+W, O).

I was able to go ahead and deploy the web part using STSADM commands from tutorials that you guys referenced in this topic, thanks so much for that.
It seems the problem I'm having involves multi-server install, and I don't think there is a quick work around yet.
Thank you all for the responses!

Follow below mentioned steps to debug this issue :
1) Browse the URL in IE on your server where you have hosted the http://mysite.com site.
2) If you are able to browse then try deploying this web part on another site by giving new site URL in project properties in Visual studio.
3) To deploy a solution onto a site you must have visual studio on the same computer where you hosting the site.
4) Try deploying WSP through stsadm, Click here to see the details. To create WSP in Visual studio right click on project -> click on 'Package' -> once its complete right click on project -> click on 'Open in windows explorer' -> open 'bin' directory -> open 'Debug' directory -> you shall see a file named as your project name & extension would be .wsp
5) If anything above doesn't help put down your deploying steps.

Please do the following
Can you first verify the Site Collection you are trying to deploy is working or not
Open the properties of the SharePoint Project >Properties(F4)> Build Tab and see that the platform has been set to Active(Any CPU).
Delete the Solution from Central Administration and then try to deploy the solution once again.
If you still have the same problem then attach the log file from the SharePoint logs.
Thanks,
-Santosh

Have you mention the Site URL property in Visual Studio Sharepoint project?. you can open using (ctrl+shift+p) for Window of Properties then Check project Properties and make sure Site
URL is the Web application where you want solution to be deployed.
might be helpful this link: http://www.dev4side.com/community/blog/2010/2/28/error-occurred-in-deployment-step-%27recycle-iis-application-pool%27.aspx

Related

"Communication with the SharePoint server is Cancelled" error when building SharePoint hosted addin

Last month, I had a Sharepoint addin installed into a clients Project Web Access (pwa) server working quite well.
This month, when I try to compile and run a new version of that same project in Visual Studio, I'm getting a popup asking "Do you want to switch the project to Offline mode?" and if I say 'No', I get a "Communication with the SharePoint server is Cancelled" error when uploading my project.
There have been no configuration changes. The only code changes were to a .JS file (and we reverted those changes, just in case).
There may have been updates to Visual Studio during that time.
I have...
Ensured that the server name is correct and unchanged.
Ensured that the 'Server Connection' property for the project is 'Online'
I can't find any useful diagnostic information anywhere.
Does anyone have any suggestions about how to resolve this, or at least how to get some diagnostic information about why it's happening?
It appears that Office365/SharePoint Online has new defaults that prevent access from external applications ( I was also unable to connect via PowerShell scripting using my Sharepoint Online credentials).
I updated the settings under Policies|Access Control in the Sharepoint Online admin console to allow connection, and now I can connect from PowerShell, and I've got a different issue in Visual Studio.
While I still don't have diagnostic information about communication problems, I've managed to get a little further.

SPSolution Pages: Where are they found?

I am currently training on sharepoint and have few weeks experice with regards to development in sharepoint. My current task involves deploying a .wsp solution on a server farm, and did that using the powershell through the Add-SPSolution, Install-SPSolution, and did that successfully. The problem I am encountering is that in the spsolution I had a webpage named TestPage.aspx, I cant find where the page is residing such that I can access it. there a specific place where the page resides or any command which I can use?
Visual Studio usually creates a folder for application pages, so you may try:
http://server/site/_layouts/foldername/TestPage.aspx
where foldername is the name of your project/solution.
If you get "The resource cannot be found" - HTML 404 error, the site is not there.
Otherwise, even if it says "An Unexpected error has occurred" it does not mean the site is not there.
The site may exist, but has some errors. In that case the best way would be to check Windows Event Viewer and logs.
You cannot just add an aspx file and deploy on sharepoint.
Maybe what you are after is how to deploy an application page, an application page sits at the application level, so every site collection will be able to access it.
How to deploy an application page:
To add an application page do the following:
create a new empty sharepoint project
add "Sharepoint "Layouts" Mapped Folder to the project
in layouts folder create a folder (usually the name of the project)
add an application page to that folder.
that application uses sharepoint masterpage, put some content in.
Deploy using visual studio or compile and deploy the wsp using the method above
access the page in /_layouts/foldernamed/test.aspx*
If you are looking only to add some content to a sharepoint page, then I suggest you use a visual web control. it is basically a user control wrapped in a webpart. After deployed you can add it to a webpart page that you can create using the Sharepoint UI.

Publish Web wizard does not appear per microsoft's instructions

According to this page, "right-click the project and select Publish (or Publish Web Site for web site projects) to open the Publish Web wizard". What then comes up looks nothing like what is shown on that page, instead I get this:
which looks nothing like the "Publish Web wizard" described on the MS page. I have tried many of the options on that page, none of them lead to asking me to import my host's "publish profile".
Is there another way I can get to the Publish Web wizard so I can import my host's "publish profile"?
Try install this update: http://msdn.microsoft.com/library/jj161045
I had the same problem. This worked for me.
AFAIK, the Publish Web wizard (just like the one that is shown in the link you provided) is only available for Web application projects, not for Web Site projects, whereas the screenshot in your original question is the tool provided in Visual Studio to publish web sites.
In my case, I found it useful to convert the web site project to a web application project following the suggestions given here and explained in detail at the LearnAsp4.com site.
Hope it helps someone :).
Hi download upgrade 5 for VS 2012 from Microsoft site and install the executable. Then VS 2012 will display the publish wizard as shown for web application.
I had an existing publish profile under App_Data that had an invalid path in the pubxml, deleting that or fixing the path fixed it for me. I found this by going to "View > Other Windows > Web Publish Activity" then either select existing or try to create a new profile from the dropdown. This then gave me an error message which "Build > Publish Web App" didn't.

SharePoint Foundation on Windows 7 Home Premium

I've installed SharePoint Foundation on Windows 7 Home Premium using the tutorial at:
http://msdn.microsoft.com/en-us/library/ee554869%28office.14%29.aspx#50
Everything went well except for the last step when I actually try to load either the site or Central Administration. Instead of a Foundation website, only a blank page appears.
I tried without success the suggested solution to change IIS -> Authentication -> Basic Authentication to Enabled.
After this change it was necessary to enter a username and password when trying to access a Foundation site. Unfortunately, after entering correct data a "Server Not Found" message appeared and I was not able to proceed.
Any ideas?
Thank you for your time,
Ben
1st step of troubleshooting this is to take SharePoint out of the equation. Setup a new web application in IIS, put in a simple 'hello world' type static html page and try and load that. If you can't then the problem is IIS/networking and not SharePoint.
For what it's worth, I've found a way to install SharePoint Foundation 2010 on Windows 7 Home Premium and solve the Windows Authentication issue (you CAN actually enable it on Home Premium as well - it's just a manual process, that's all).
You can find the steps I followed on my blog at http://www.rl-soft.com/en/blog/Lists/Posts/Post.aspx?ID=21
Hope this helps a few folks!
Raphael.

Page Not Found Error on SharePoint Sites in TFS

I'm in big trouble here, today i was asked to add a new user to TFS, the first thing I do is adding it to SharePoint, but now every time I tried to enter the project portal (Team Explorer -> right click on project -> Show project portal) I got an page not found error, with every single project, Here are some basic info about the setup:
2 Tier TFS, TFS server, ReportServices and SharePoint are on the same server.
If I try to enter administration portal on this server (cd21vids1 is the tfs server)
http://cd21vids1:17012/ -- I get Directory Listing Denied
http://cd21vids1:17012/default.aspx -- I get the default page, which works OK.
If i enter a project site i get this results (88 is the default port for SharePoint in this server):
http://cd21vids1:88/Sites/Cnbv.Framework/ -- Page not found
http://cd21vids1:88/Sites/Cnbv.Framework/default.aspx -- I get the page but with no styles and the layout is wrong, also i get an error on the "remaining work" report (directory listing denied), the reports that have problems are "Issues List" and "Exit Criteria Status" (Directory Listing Denied on both cases).
Everything else seems to work OK, (builds, check-ins), I hope you can help me out, thanks.
Juan Zamudio
UPDATE: I did some more tests, i get a page not found error in the url
http://cd21vids1:88/Sites/Cnbv.Framework/_styles/core.css
Maybe this is way I get the default page without the correct layout.
UPDATE2: Also when I click the "Windows Sharepoint Services Site Administration" link I get this error:
"The Team Foundation Server could not locate the online Site Administration application for this team project portal in Windows SharePoint Services. The most likely cause of this error is that the language settings on the team project portal do not match the current language of your Visual Studio client. The location of Site Administration is specific to the language of the project portal. Contact the Team Foundation Server administrator for availability information of Site Administration for this project portal. For more information, see the Windows SharePoint Services Administrator's Guide."
Someone changed the language to the server from English US to Spanish MX, I changed the language back to English and restarted the server but no dice (BTW I already had a folder named 2058 in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\" like explained in this post
my SharePoint problem is fixed, here are the details.
Run "SharePoint Product Technologies Configuration Wizard"
1.1. Select do not disconnect from this server farm, click next
1.2. Select No, this machine will continue to host the web site, click next.
1.3 Click Next
Restart IIS
I have had the same problem with the core.css file. I didn't want to use Sharepoint designer to solve it cause it would have unghosted my site!
So I tried this (it works) : on the site administration, go to "master page", and down the page you have a way to redefine the css used for the site. So i put there the url :/_layouts/1036/Styles/core.css (1036= French, so use 1033 if you are site is in english!), and after validation it worked.
The problem is that the page still try to get the core.css from http://MYServeur/_styles/core.css ..and return a 404!
But at least I have my style back. I just post it in case... I still hope a real better solution...
AJ

Resources