question

JaredSeverson-5477 avatar image
0 Votes"
JaredSeverson-5477 asked DylanZhu-MSFT commented

Console App (.NET Core) Issue

My new organization has an internal web app for product maintenance and reporting. A server was changed out and parts of the app need to point to the new data source. I updated the IP address of the existing connection to point to the new server in Server Explorer. But, the change hasn't taken hold and a certain field on one of the forms keeps freezing the program when data is typed. Normally it searches on the old server DB to let you know if the item code already existed. I didn't build the app, and have very limited experience using Visual Studio. I'm guessing we need to push the change to the production version in IIS on the server hosting the app? How do I get the new IP address update to take hold on the production app?

Any insight will be greatly appreciated!
Thank You

dotnet-csharpvs-generaldotnet-aspnet-core-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JaredSeverson-5477 , please try to re-create a new data source connection in server explorer. If it doesn't work, could you provide more details about your data source and some code block.

0 Votes 0 ·

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered

Server Explorer in Visual Studio? That has nothing to do with code you're running in your app. Server Explorer is a tool in VS to allow you to browse server resources on your network. Personally I never use it.

You are being a little vague on what the actual problem is beyond a moved server. If you are referencing a database in your app and you moved the database then the database connection string needs to be changed. If you follow standard practice then the connection string is stored in your app's appsettings.json (and environment-specific files). Update the connection string in those files and your app will use the new database.

If you hard coded the connection string in your code then move it to the appsettings.json file and then fix the connection string as mentioned earlier.

Note that changing appsettings.json does not require a rebuild of your app. You can technically go to your hosted app in IIS and change the settings in the file and restart the site and it'll use the new settings.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.