asp.net mvc 4 c# plus mongodb driver - c#

I would like to know if i use my web app in production in shared hosting, will be there a problem to use mongodb driver c# (driver is embedded in the project or need host support for that)?
Because I'm planning to use dedicated mongodb server.
Thanks.

The C# driver is just a set of DLLs, so you're fine.
The only thing to check is that the shared host will allow traffic over whatever MongoDB port (it uses 27017 by default, although you can change that).

Related

Embedded C# web server with easy SSL support

I am looking for an embedded Web Server with out of the box SSL support, preferably configured from a command line or some easy config, without the need to change system wide config (like Registry). It should also work on mono.
Have you tried my old server http://webserver.codeplex.com? It supports SSL and at least used to run on MONO.
I'm also (slowly) building a new one, it got no SSL support yet (but's not that hard to implement by yourself): http://github.com/jgauffin/griffin.webserver
Edit
The HttpListener in Griffin.Framework have SSL support now
I recently came across two such packages.
ceenhttpd - https://github.com/kenkendk/ceenhttpd
and
uHttpSharp - https://github.com/Code-Sharp/uHttpSharp
The part i like about these is that both of them let you load a certificate file from disk. If you use the raw HtttpListener, that is a pain.
If you are open to use .NET Core, you can also self-host Kesterel. I plan to use this as soon as I convert my projects to .NET 5. here is a small sample code for that.

Hosting MongoDB on Windows Azure for C# Access

I have read this page: http://www.mongodb.org/display/DOCS/Azure+Deployment, but it seems to be talking about actually setting up an Azure application, which I'm not interested in. I just want to host a Mongo DB on Azure which I can access from some non-Azure application using a connection string. I also tried running the script on this page: http://www.mongodb.org/display/DOCS/MongoDB+Installer+for+Windows+Azure but it threw an exception when it tried to validate the image name. Is what I want possible?
The reason for all of this is that I'm trying to compare MongoDB and Azure Table Storage, and I want to make the scenarios as similar as possible when I performance test.
The first link in your question talks about deploying MongoDB in Windows Azure (also accessible by other applications), but this in a traditional PaaS context. This means you'll be deploying MongoDB in a hosted service/cloud service.
If you want to host MongoDB on Windows Azure in a way that "feels more natural" you should consider deploying it in a Virtual Machine (the second link in your question). There's actually a how to on the Windows Azure website that will guide you through the whole process of creating a VM and deploying MongoDB on that VM: Install MongoDB on a virtual machine running Windows Server 2008 R2 in Windows Azure
Both ways to deploy MongoDB will allow you to access it from non-Azure applications, you'll simply need to configure the endpoints correctly (allowing access to specific ports from outside the datacenter).
Note that Virtual Machines (IaaS) is still a preview feature and the performance in the preview might not reflect the performance of the final version.
You can run MongoDB on Windows Azure two ways. First way is to run as Cloud Service which is described here however this is not what you want.
The second option to run MongoDB on Windows Azure to use Windows Azure Virtual Machine (either Linux or Windows) and then install MongoDB on it. The link below explains how you can install MongoDB on a CentOS machine in Windows Azure:
https://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-on-a-linux-vm/
If you decide to use Windows Virtual Machine, you sure can use any MongoDB tutorial to install it on Windows box after configuring Windows Virtual Machine or just use this one.
As you have already tried using Powershell to deploy MongoDB from your desktop to Windows VM, but failed to get working, please write another question with error details and i sure can help.
Finally based on your actual objective I would suggest creating MongoDB on CentOS by following above tutorial and get your test done, which could be easiest MongoDB setup among all the methods we have talked.

Google App Engine ASP.net

I am new to Google App Engine. What i really need to go is host my web service which is written in ASP.net & C# on google app engine.
My web service gets a string and translate that string from already stored translated values in the database which is SQL server 2008 R2. This translated string is in the form of spans. i then return the string.
thanks
The Google App Engine currently supports applications written in Python, Java and Go and won't run ASP.net applications unless some heavy magic (such as compiling it to Java bytecode) is involved and I'm not aware of anything that can do that specific trick.
Maybe you should consider Microsoft's Azure. It's kind of an equivalent PaaS solution, but will play with Microsoft's stack.
Note: Google has since added PHP support.
Note: Now Google has the "custom runtime" that allows you to host pretty much anything you can run on a Linux machine.
It should now be possible to host ASP.NET applications on App Engine. Use the custom runtime feature on App Engine and Microsoft's ASP.NET Docker image with your application. Also, you need to create a route for /_ah/health and respond with HTTP status code 200 and a blank message body (see lifecycle events).
You can not host C# applications.
Google App Engine is focused in supporting three application environments only: Java, Python and Go.
Additionally App Engine applications can also be written in any JVM-compatible language (e.g. JRuby, Groovy, Scala, etc.) and run in a Java 6 runtime environment.

Bluehost, Best way to run server

I have Bluehost account and the way I connect to the MySQL database and handle requests from remote devices is to use PHP scripts. I was wondering if I could run my server using C# instead of writing PHP scripts.
It doesn't look like Bluehost provides any support for C#. If you want to program web sites in C#, you need to look for a company that offers ASP.Net hosting.

Embedded Web Server in .NET

I would like to embed a light weight web server in a Windows application developed in .NET. The web server has to support PHP.
I have looked at Cassini, but it seems it is ASP.NET only.
The .net class HttpListener exposes the underlying http.sys upon which IIS is built. All machines since Windows XP2 have http.sys installed by default.
Here are some links to get you started.
XML-RPC SERVER USING HTTPLISTENER
HttpListener For Dummies
As for the PHP support, I don't know how you would enable this, but there is no technical reason you couldn't build it in.
I would look at the likes of XAMPP Lite which you could easily start up and shutdown with your application.
There is also AppWeb which claims to be exactly what you are looking for.
You can always use PHP as a CGI application. CGI is well documented, and AFAIK pretty easy to implement. Use Darrel Millers suggestion, and couple it with some CGI magick, and you should be cooking with gas.
Mongoose embedded webserver
https://code.google.com/p/mongoose/
You can build it with VS2012/10/08 as EXE and you can use PHP and also websockets to push data to the client app. Also you can build a DLL you can do this with make or bring the code into a VS DLL project and build out a _DLLMain, DEF file, etc. Then use it direct from C# - see the mongoose.cs and example.cs files.

Categories