I have a question regarding how to write a windows server side application.
We have now have a system whose client is .NET 4.0 based and a server side application running on jboss on Linux. The server application talks to an Oracle DB.
I am now thinking to move the server side to Windows and DB to SQL server. The server application should be written in C# on .NET as well. However, there seems no Application Server equivalent on Windows. How is a server application normally written and deployed on Windows?
Many thanks
There are a few options, but the very basics would be
Host WCF web services in IIS and take advantage of the management IIS offers, you can bring AppFabric into the picture for more robust and manageable hosting.
Self host your service in a Windows Service.
If it suites your application I would say the AppFabric solution is worth looking at. But this is not a 1-to-1 with with a Java Application Server.
Update
Self hosting WCF is as simple as the follow
host = new ServiceHost(typeof(YourWcfService));
host.Open();
This assumes that you have defined a service called YourWcfService'. The above code in theOnStart` of a Windows Service will start accepting requests to your service. Of course this still requires all the basic configuration in the app.config file.
AppFabric, however gives you a nice environment to manage and monitor your services, so not to sound like a broken record, but I would look into it to see if it is possibly a good fit for you.
Update 2:
I did a quick bing and found this MSDN post, it is oldish but looks like a good example.
http://msdn.microsoft.com/en-us/library/bb332338.aspx
It's not exactly true, there are couple of almost unknow but powerful tools that you can use free:
NetFluid: http://www.netfluid.org/
Service Stack: http://www.servicestack.net
Related
I haven't been able to find any information on what is required to deploy a .NET CORE solution to a linux environment. I was asked to specify and detail on the requirements to go to production.
We are developing a .NET CORE Web API wich hits a SQL Server database, the client will be an Angular 2 app. I read about .NET CORE is cross-platform, so besides to Windows one could deploy to Linux and OS X. I guess Kestrel is the main piece here, but I'm not very sure of what is the correct infrastructure to deploy.
Do I need multiple servers?, one for the API, one for the DB since SQL Server isn't cross-platform, one for the client app? Additionally, do the severs will need any special configuration?
Shortly: What do I need to ask to our company infrastructure team in order to avoid any misconfiguration when going to prod?
Thanks in advance.
Do I need multiple servers?, one for the API, one for the DB since SQL Server isn't cross-platform, one for the client app?
If you host MSSQL Server on Windows - yes, you would need at least 2 machines. One with Windows and one with Linux, given that you must host your API on Linux. For the client app you do not need a separate server and you can host it on the same server as API.
Also, you can host everything on Windows (MSSQL Server, API, Angular app).
You can take a look at MSSQL Server preview for Linux. MSSQL Server on linux
Additionally, do the severs will need any special configuration?
No, you can just build your .net core api for linux and copy it to the linux server and it will work. For the web server you would need any reverse proxy like NGinx or HAProxy. Here is a good tutorial from Microsoft Linux environment + nginx
So I have zero experience with deploying software or putting something live. The situation is like this:
I have developed a dashboard web application on a laptop. This application uses a microsoft SQL database that also runs locally. When I run it, it's a localhost address. Now, I need to be able to access my web application from other PCs within my company's network. This way I can do some user testing. What are ways to do this? I searched and things confuse me to no end.
I use:
.NET Framework 4.5
Visual Studio Ultimate 2012
IIS7
Thanks
There are a few things you'll need to do to make your local application visible on the network. I'm assuming you want your app running on something like http://foobar/myapp where foobar is the name of your machine
Here is what you need to do:
Add a URL reservation so your machine will allow IIS to serve content on the url http://foobar/myapp
Create an inbound rule in Windows Firewall to allow incoming connections on port 80
You can find the exact commands you need to run on Scott Hanselman's excellent blog post. Of course, he's focusing mainly on getting SSL to work with IIS Express, but it has enough pointers to get you going, too.
look at msdn.microsoft.com
you can learn about:
Prerequisites
Creating the Web Site
Creating a Test Page and Class
Publishing the Web Site
Testing the Published Web Site
Next Steps
I am relatively green with C# and WCF. I have landed on a project where I am creating self hosted WCF services running as Windows services but am starting to wonder if I should use IIS instead (which we don't currently use) as managing all of these services could eventually get cumbersome.
Despite my best efforts, I have yet to find any definitive information about why I might favor one approach over the other. The services are primarily used for utility stuff like resizing images, retrieving files, etc. and are called by both C# and Java clients.
Thanks
The shortest answer would be 'it depends'. On your requirements. You can self host without problems, but IIS will manage resources more effectively and enable you to fine tune stuff more easily than self-hosted.
For instance, in IIS would be more simple to deploy a new version or remove and old one.
Either way is fine.
Generally, using the builtin IIS hosting capabilities can make deployment and configuration simpler for you. Also you have the activation model of http.sys - which means IIS will start the necessary process for you when an appropriate message arrives.
Clients of any platform can connect to the WCF services regardless whether they are self-hosted or IIS hosted.
ps: how to allow IIS-hosted WCF services to store their configuration data in distinct xxx.config files
I am developing a Windows application using the .NET framework. I am exploring the best ways to integrate a web server in my application that listens to localhost:8080 (or whatever port). I do not want to compromise on the security of the user so I would like to use some library or existing web server application that is secure and does not have vulnerabilities.
So I rounded myself to 2 ways -
1) Using a popular web-server like nginx or apache - and invoking it through the application (and running it as a process with CreateNoWindow = true;).
2) Using a web server written in C# or C++ like WebServer.
What would be the best way to do it? I am open to more suggestions.
I have done this 3 ways in .NET
If it's a web service or Data service your can use the ServiceHost to host your own endpoints
IIS Express is probably the most robust and "proper" solution, unfortunately it's still in beta. You can get it by downloading Webmatrix. http://www.asp.net/WebMatrix
The source code for the webserver embedded in Visual studio is available, it's called Cassini. I've used it on a few projects. It's available as source or even packaged:
http://code.google.com/p/cassini/
http://ultidev.com/Products/Cassini/
I'm looking for some input on my current project architecture. There are three components: Server, Desktop, and Mobile Device.
I have 2 goals:
1) Send data (Approx. no more than 100 KB of text) from the Desktop (multi platform client application running on windows XP/Vista/7, and Mac OS X) to a server (Windows Server 2008, IIS 7, WCF RESTful service) to save in a database (Sql Server). The services need to be scalable because the number of desktop devices and frequency they send data is unknown.
2) A service to retrieve data from the database (Sql Server) and send to a mobile device(Iphone and Android application. Message size no more than 100 KB of text). Service needs to be scalable because number of mobile devices and frequency they connect is unknown.
My proposed solution:
Server Side (Sql Server and Windows Server 2008):
I'm looking at a WCF RESTful JSON services to communicate with Desktop App(s) and Mobile App(s). I like WCF because I am most proficient in C#, have some experience implementing WCF, after doing some research it appears all technologies used for the platforms(Windows XP/Vista/7 and Mac OS X) can easily communicate with the WCF RESTful service.
Any high level fundamental issues with the WCF service in this scenario?
I have only implemented WCF on a Windows Server 2003 machine with ~800 devices connecting every 15 minutes. The server was a physical in house server running on a private network. I need this solution to be hosted and scalable. Any recommendations for hosting a Windows Server 2008? Is there a better technology to host the service? (I'm not very familiar with how the cloud stuff works)
The services will be saving and retrieving data from a SQL server. I would like to use LINQ to SQL as my data access layer. It's my understanding there are large licensing fees tied to SQL server so I may need to go with SQL Server Express for now.
I'd prefer to keep the WCF services and database hosted separately (2 diff machines). Any recommendations for hosting sql server(or express)? Is there a hosting service that can scale better for my database? Does it make sense to keep these on 2 diff machines?
Desktop (Client Side)
I am required to develop for Windows XP/Vista/7 and Mac OS X. I plan to write a .net application to run on the windows machine(s). I"m still up in the air if i'm going to write (and learn :P) XCode or try mono. Any cross-platform ideas?
Should I expect to have any fundamental problems getting the desktop applications to talk to my WCF RESTful services?
Mobile Applicaitons
I am required to developer for the IPhone and Android. There are many examples of making WCF RESTful service calls using Objective C and the Android SDK. I'm considering trying a cross platform (ie. Appcelerator). From a high level it appears these mobile cross platforms have built a Java script layer that works with both IPhone and Android!
Any thoughts on using the cross platform technology to write ONE mobile app to run on IPhone and Android?
Any fundamental issues calling the WCF RESTful service in javascript?
Sorry for the somewhat long post. I have never designed a solution of this size. All feedback is appreciated.
Thank you!
As you are clearly wanting to use Microsoft technologies - the suggestions about Mono probably make sense to you and will certainly make things easier.
However I think you may find that you compromise elements of the user experience for Mac and iPhone users which is not ideal as these users tend to have the highest expectations for great user experiences.
I understand that we don't live in an ideal world but if we did you would develop a separate client for each platform - optimised to the needs of each platform. Unless you application is doing a lot of data manipulation the data layer is now abstracted to the server viw your JSON interface so you will not gain much from sharing the data objects across implementations.
As it seems you are implementing the project in a small team (yourself?) then I would suggest that you look at implementing a web solution with the HTML javascript communicating with the server over JSON.
The other option is that you use a flex/air client on windows and mac and flash on the android and Adobe's solution to compile flex/air into iPhone code.
Good luck though.
For your client side you may consider using Appclerator because it will run on all of the platforms that you need with little to no extra code, and it is designed to be used for web app type applications
You should consider MonoTouch for the iphone. You'll be able to share much of the desktop code. I would use Mono on the Mac for the same reason. Android is the odd man out. Eventually someone might create something like MonoTouch for Android but not soon enough to help you out.