We help IT Professionals succeed at work.

Error in SharePoint 2019 deployment

I am testing some web parts in SharePoint 2019 that were developed for SharePoint 2010. I have installed Visual Studio 2019 on my dev server, and the projects have been upgraded when Visual Studio offered to do so.When I try to deploy a web part, I get the error: "Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: http://ehnordic/default.aspx/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project..."
I have double-checked the URL (it is an internal URL) and it is correct. Then why do I get this error?
Comment
Watch Question

ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:

I see three points in your URL that I do not understand.

  1. Why do you not enable https?
  2. Why is your DNS name without top level domain?
  3. Why do you have a forward slash after .aspx in your URL?



Walter CurtisSharePoint AED
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:

Not sure what these web parts do, but it is very unlikely that a SharePoint 2010 web part can just be converted to work in SharePoint 2019. The error is a generic error when things aren't working.


If you could recreate the web parts specifically for SharePoint 2019 that would be much better.


Good luck...

Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:

1 and 2 are probably because it is a dev server


How complicated is the webpart? Can you recreate it?

Author

Commented:
@Zvonko - 1. When I setup the server, I was asked for a name of the web application and I entered ehnordic, then the URL became http://ehnordic, and it works for the pages that are there
2. I'm not sure what you mean but the server name is different from the application name, if I simply enter http://<servername>, then I get a standard IIS welcome page
3. I tried to remove that, but Visual Studio puts it back by itself, whenever I save, rebuild or deploy.
ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:

Uhps!

Take Shaun advice and repeat the creation of SharePoint site collection.

Use a full qualified server name and not only workstation name.

Also give the Site Collection a real name. Anyhow is your site collection name created as: default.aspx!


That will not solve your migration problems but would simplify next steps in the future.



Author

Commented:
I tried to rename the site to <servername> in IIS Manager, but it still uses the old URL. "Binding" is still the same, maybe that's the reason

Author

Commented:
@Shaun Vermaak - I have tried to create a new webpart, but I get the same error when I try to deploy
ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:

Reason or not, recreate it for clarity.


Author

Commented:
I have deleted the previous web applications and created a new one where application name=servername on port 80, then a new site collection. I can see the SharePóint root site fine in Internet Explorer. However, when I try to create a new solution in Visual Studio, it suggests http://spsdfrdtc03/SitePages/Home.aspx. When I click on Validate, I get the error "Cannot connect to the SharePoint site: http://spsfrdtc03/SitePages/Home.aspx/. Make sure that this is a valid URL..."
So it still doesn't work.
ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:

Again, why http without ssl?

And why workstation name without real DNS path.

Like this:

https://spsdfrdtc03.mydomain.com



ZvonkoSystems architect
CERTIFIED EXPERT
Top Expert 2006

Commented:

And your current Site Collection url is this:

 http://spsfrdtc03/SitePages/


Not this:

 http://spsfrdtc03/SitePages/Home.aspx/

Author

Commented:
Thank you for your input, it didn't help to specify full DNS name or a site collection url without Home.aspx.
I'm now looking into whether my user has full rights to the database (even though it's the same user that created the web application), since I read that could create the problem.
Walter CurtisSharePoint AED
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:

Here are a few point to consider:


  • As mentioned a couple of time already, you may need to recreate the web parts. A huge difference between SP 2010 and 2019 and depending upon the web parts, it is very likely your old web parts will no longer work with SP 2019.
  • As far as the site collection name, you can use the machine name of the workstation or server that SharePoint is installed on in your url. You need to make sure that the name can be reached, meaning a DNS entry or a local host file entry with the IP address of the machine you are trying to reach.
  • If SharePoint is installed on the same machine as Visual Studio make sure you have that machine listed in the host file with it's ip address. Don't depend on the 127.0.0.1 localhost to work correctly, Visual Studio doesn't seem to understand that ip as a valid local host ip.
  • If you have doubt about the correct web app name, check in central admin to determine the web app or root site collection name.  The top level site collection should be able to be reached with just the domain name (machine name) and top level suffix you decide to use. 
  • Keep in mind, you should not need to touch IIS when dealing with SharePoint in most cases.
  • For a test environment, you don't need to use SSL or a top level domain. You can use a non routable domain name such as .local if you prefer to.  What't important is that your SharePoint server(s) are a member of an AD domain.


Hope that helps...


Author

Commented:
I am sorry this problem is not so easy to solve.

I am prepared to recreate the web parts, but right now I get this error no matter what I try to deploy.
I tried to enter the server name (spsdfrdtc03) in the hosts file, but it still doesn't work. I have no problem reaching the site with Internet Explorer.
I did not touch IIS in the latest reconfiguration (new webapp and site collection)
Commented:
It turned out that I should simply use the Site URL http://spsdfrdtc03/ (so server name only). Simple, but in all the reconfigurations I didn't try this option. A good thing is to use Tools - Add SharePoint Connection to check what works.
Thank you all for your advice.

Author

Commented:
Thank you again for your comments and advice.