How to deploy a C # .net application using MongoDB

I am new to mongoDB. I would like to ask for help in deploying a C # .net application with MongoDB. I tried to publish it, but when I run it doesn't work. I know that the error is that I need to manually run mongod.exe through C: / mongodb / bin / mongod. But how can I configure it without manually starting mongod.exe? Your help is much appreciated. Thanks:)

+6
source share
2 answers

You must understand that your .NET application and the Mongo database are different parts of the system. They can even be placed on different machines. Therefore, the publication of your application should not affect the availability of the database. However, you can combine these two actions into one simple batch file:

msbuild.exe [your app with necessary options] C:/mongodb/bin/mongod.exe [options] 

About how to create and deploy web applications using msbuild , you can see here:

+1
source

You probably want to configure mongodb to run as a Windows service, rather than manually starting the server on demand.

Instructions can be found here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/

+1
source

Source: https://habr.com/ru/post/952306/


All Articles