how to publish kentico 13 .net core site

lawrence whittemore asked on August 6, 2021 18:42

anyone care to walk me through the best way to publish a site. I am trying to take it from my local machine and put it onto a staging server to start. Once I get that working I'll need to move it to our productions servers.

I used Visual Studio to publish the site to a folder and moved the folder to the staging server. In my publish settings I did add the proper database string.

I get this error when i try to load the site in a browser

ApplicationInitException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Correct Answer

Sean Wright answered on August 16, 2021 15:46

Lawrence,

Most of these questions aren't related directly to Kentico Xperience - instead they are the details of using ASP.NET Core / IIS. Maybe you can check out Microsoft's documentation:

In regards to the CMSCIRepositoryPath, that is only important if you are using the Kentico Xperience Continuous Integration feature.

0 votesVote for this answer Unmark Correct answer

Recent Answers


lawrence whittemore answered on August 6, 2021 20:36

just trying to get it to run locally from a published folder and I get this error.

NullReferenceException: Object reference not set to an instance of an object.

CMS.Membership.Internal.VirtualContextAuthenticationConfiguration.get_Audience()

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on August 9, 2021 11:12

Hi Lawrence,

What database are you using? Is it Azure SQL or SQL server installed on VM or something different? Also, how did you deploy your database?

0 votesVote for this answer Mark as a Correct answer

Sean Wright answered on August 12, 2021 00:45

Lawrence,

We'll definitely need more information to assist you.

  1. Are you deploying the .NET Core / .NET 5 application or the .NET 4.8 CMS application?
  2. How are you creating the deployable artifact?
  3. If you are deploying to IIS on a VM, you need to make sure you point the Website to the correct folder - IIS doesn't do this for you.
  4. Have you checked the Connection String (in either the web.config or appsettings.json)?
  5. What domain are you running the application under? Do you have a license installed in the application for this domain?
0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on August 16, 2021 14:15

Sorry for the very slow response. I was on vacation last week and didn't get a chance to follow up yet. I am deploying to IIS and it is the .net core application. I am using the publish to folder from visual studio. The database is sql server. For the database, I created a back-up from my local machine and restored a new db on our staging db server. my guess is, the permissions in here are what are messed up but I could be wrong.

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on August 16, 2021 14:19

what is the best way to publish this? Is there a way to make the appsettings point to my local db as well as the staging db as well as a production db so that we don't have to constantly change the connection string when testing and deploying? Sorry for all the newbie questions. this is our first time deploying something in .net core.

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on August 16, 2021 15:12

another question, in the app settings there is a CMSCIRepositoryPath line that points to a local folder. Is that important?

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on August 16, 2021 18:54

I think I am getting closer, no longer getting sql error but instead getting this

NullReferenceException: Object reference not set to an instance of an object.
CMS.Membership.Internal.VirtualContextAuthenticationConfiguration.get_Audience()
0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on August 16, 2021 18:54

ha, interesting, looks like I was already getting this message at one point.

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on August 16, 2021 19:01

So I figured it out. Because I had logged into the admin yet to change the site settings to match the new server.

0 votesVote for this answer Mark as a Correct answer

Joel Dahlin answered on September 14, 2021 17:06

@lawrence, what site settings did you have to change? The presentation url?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.