IIS installation of 4.2

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi All,
I've just managed to deploy my nopcommerce 4.2 installation to my local IIS, however it seems to be having issues connecting to the sql database. What are the best practices surrounding this?
I want to have a local copy of a deployed development environment on my machine.
If I launch the NopCommerce through the visual studio solution, everything works fine (which is how I setup the Db).

I have looked at many articles and tried many things to get this working, but have hit a stumbling block.
My connection string is currently: "DataConnectionString": "Data Source=(LocalDb)\\MSSQLLocalDB;Initial Catalog=Nop42;Integrated Security=False;Persist Security Info=False;User ID=NopDb;Password=*****"
And I have the app pool identity set to applicationpoolidentity.
The error I get for those creds are:
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.

When i use integrated security with the app pool identity set to local system, i get this error (ensuring there is a 'NT AUTHORITY\SYSTEM' user in sql):

Cannot open database "Nop42" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\SYSTEM'.
5 years ago
Hello,

You have to add login user at SQL NT AUTHORITY\SYSTEM

Also permission is require to access all read ,write operation at SQL

It's very easy search on google there are plenty of ans there.

Still if you face error let me know i will try my best to solve this issue.

Thanks,
Smiten kalathiya
5 years ago
Yes I have already done this and follow many tutorials around that.
Ie.
https://stackoverflow.com/questions/53722376/asp-net-core-web-api-publishing-to-iis-producing-an-sql-server-connection-error

https://stackoverflow.com/questions/38441894/sql-wont-connect-after-deploying

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/da64b280-6b90-4af2-a677-904e696a50f9/login-failed-for-user-nt-authoritysystem-in-sql-express-2005?forum=sqlexpress

https://blog.sqlauthority.com/2009/08/20/sql-server-fix-error-cannot-open-database-requested-by-the-login-the-login-failed-login-failed-for-user-nt-authoritynetwork-service/

I have tried all these things, but still having issues, am i missing something?
5 years ago
When you run the Install and Create the connection string - the same connection string can be used in Visual Studio and when just running under IIS

In my configuration the login for the database is the Application Pool name (and website in IIS)


I use the following method to setup local domain names - then I can either use Visual Studio to debug or use the development website outside of visual studio running in IIS

The IP of my machine on the network is 10.0.0.16
I have the following in my hosts file
10.0.0.16  localtest.SSI-Net.com.au
10.0.0.16  localtest1.SSI-Net.com.au
10.0.0.16  localtest2.SSI-Net.com.au
I run Visual Studio in Adminsitrator mode (right click on the desktop icon)
In Nop.Web properties (right click to get to properties)
Debug Tab > Web Server Settings  > App URL
Enter   http://localtest.SSI-Net.com.au/
When I run the debugger it starts the browser with  address  http://localtest.SSI-Net.com.au/
Then when it is running I can change the address to
localtest1.SSI-Net.com.au
or
localtest2.SSI-Net.com.au

Next step is to publish the Nop.Web to a local directory. This is my local copy for production backup in development then I copy this to my remote server for production. If needed I can change the directory in IIS to point to this local published version (then change it back again for VS development)

In this way I can develop in Visual Studio (for multistore), run it on IIS to test (if needed)
publish a local copy (for backup), then copy local publish to production server

Anyway thats how I manage it.
5 years ago
I know this topic is titled "IIS installation", but for what it's worth, you don't need IIS to test locally...

After I test in Visual Studio, I Publish to a local folder, and then I just go to that local folder (File Explorer), and double-click the file Nop.Web.exe
5 years ago
I don't need a local to test code, its more to test deployments / scripts, plugin behaviors outside the solution etc etc.  before it reaches a public environment.

Thanks Yidna, I will give these steps a go.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.