Avatar of kasperEH
kasperEH
Flag for Denmark asked on

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?
.NET ProgrammingMicrosoft SharePointMicrosoft Visual Studio

Avatar of undefined
Last Comment
kasperEH

8/22/2022 - Mon
Zvonko

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 Curtis

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 Vermaak

1 and 2 are probably because it is a dev server


How complicated is the webpart? Can you recreate it?

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
kasperEH

ASKER
@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.
Zvonko

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.



kasperEH

ASKER
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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
kasperEH

ASKER
@Shaun Vermaak - I have tried to create a new webpart, but I get the same error when I try to deploy
Zvonko

Reason or not, recreate it for clarity.


kasperEH

ASKER
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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Zvonko

Again, why http without ssl?

And why workstation name without real DNS path.

Like this:

https://spsdfrdtc03.mydomain.com



Zvonko

And your current Site Collection url is this:

 http://spsfrdtc03/SitePages/


Not this:

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

kasperEH

ASKER
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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Walter Curtis

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...


kasperEH

ASKER
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)
ASKER CERTIFIED SOLUTION
kasperEH

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
kasperEH

ASKER
Thank you again for your comments and advice.
Your help has saved me hundreds of hours of internet surfing.
fblack61