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
Related
Not sure where to ask this but figure someone might be able to shed some light on it. I am new to the whole .net core stuff and have been learning and taking some online classes. My question is this I am trying to self host a webapp/site what I am making in visual studios 2015 in C# using .net core 1.1. I have the app up and running locally when I run it in IIS Express everything works fine. What I cant seem to figure out is how to publish this to my windows 10 system. I have been digging around the web an came across a few articles but even following there steps it seems i cant get this thing to publish. Has anyone here run into the same situation and have gotten it working or know what i need/how to configure windows 10 and IIS to get this running ? Thanks in advance for any help given.
Here is the guide for configuring Kestrel to use IIS as a reverse proxy:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/
Note that you do not want to use Kestrel by itself as it has not been hardened against attacks yet.
That said, what you are trying to do is not likely to work. For starters; IIS running on a desktop OS is limited to 10 concurrent connections, so having a real live website is just not going to happen. Furthermore, you need a static IP for the server to be consistently reachable via DNS. That service usually will cost you quite a bit (more than just using shared hosting).
The easiest way to host this would likely be in a free Azure Web App.
Our web application is developed by 2 teams. One team works on the client side, with it's own Branch for development, and the other works on the server side, also with it's own development branch. The client and the server are running separately, each one as a website on a different port. The websites are hosted over IIS Express during development, and in production they will run over IIS.
Our ideal situation is that each team can develop completely separately and whenever a develop session is over, both teams merge their change-set to a common Branch in order to integrate, than each team merges back to their development branch, and continues.
In order for a full separation, We have x2 SERVER projects, one to handle the real HTTP requests and another one, a "Stub server" Which responses to all the clients HTTP requests with default values, just in order so that the Client side team can test their code without being dependent on the functionality of the server.
The problem is that both the "Stub server" and the real server and using the same Port which the Client side project is directed to.
This causes many annoying mistakes (mostly for the Server side team) of running the application with the "Stub server" instead of the real one, during reviews, tests etc. The only solution for us is to manually create a virtual directory for the real web server project every time before running / or after finding out we were running the wrong server.
Is there a smarter solution to overcome this annoying problem? That would improve our lives!
If anything I said was foolish / not clear please correct me (I'm new to this), or ask for more details, I'll be glad!
Thanks for helpers!
I believe your problem is more related to build automation then server configuration. You should really keep the stub server and the real server into separate ports, and change that port during some kind of build process of your client.
If you are using AngularJS, then I suggest you to create steps into the build process of your client application using common tools like gulp or grunt. You could create build processes that will set a global variable or modify a constant (e.g. the API endpoint) and name them local testing (pointing your client to the stub server) and integration (for the real server).
Please note that you can easily integrate those build processes into Visual Studio, making them part of your global debug/build process.
Here it is a simple gulp task useful for replacing text inside any file: https://www.npmjs.com/package/gulp-replace
I have been through WCF and related topics, created my first WCF service. It works fine but the problem is that I don't understand hosting concept.
Different tutorials do different things like some create separate console applications for it to host service then using it in Asp.net app but some doesn't host it in any place and just add reference to another project and use it.
I don't understand that when to host where and why?
Please help me in this issue. I am using Visual studio 2013 with .net 4 and asp.net c#.
Basically, a WCF service needs to be hosted somewhere, so that it can be accessed from somewhere else. There are several ways to do this (and probably more than I know about too), but two of the most simple and common ways are to host the service in IIS Express, or in IIS (Internet Information Server).
IIS Express
The simplest way to achieve the first (IIS Express), is to simply right click the project in Visual Studio, and select View in Browser. That will open a directory listing in your browser, and in that directory you should see a file ending in .svc. Clicking that file should open the service description page with text like:
You have created a service.
To test this service, you will need to create a client (...)
The URL to that page, is in effect the URL clients will need to connect to your service. It should look something like http://localhost:64835/YourServiceName.svc.
That means the service is hosted locally, at port 64835, and accessible for clients at that address. Since this is in IIS Express however, it will no longer be accessible once you've closed Visual Studio, since it only runs as part of it.
IIS proper
Hosting in IIS means your service will be accessible whenever IIS is running. Once installed, it will usually start up when you log in, and run silently in the background. When it is running, you can start your service simply by accessing the correct URL. If it is not running, it might take a few seconds to start it. The next time it is called, it should respond quickly.
Note that in IIS, an application will by default run on port 80, which is the default port checked by browsers and possibly other clients - which means you don't need to specify it as in the example above. The URL will therefor generally be something more simple, like http://localhost/yourservice/yourservice.svc (although you could configure it to another port, or another protocol (say https://.., or something else if you like).
Once configured, and the relevant port is open however, your service should be accessible to the rest of the world.
Note: From the outside world, the URL will be different; it could be something like:
http://123.456.789.123/yourservice/yourservice.svc, if that is your IP address, or
http://yourdomain.com/yourservice/yourservice.svc if you've set up a domain.
I would suggest you consider hosting under two categories:
Self Hosting
IIS Hosting
As per you question "when to host where and why", I would say that you self host a WCF service only during testing. Mostly, self hosting is not used in live/production environments. For production environments use ISS hosting.
Self-hosting would be useful for testing on the local machine and on the intranet, while IIS hosting would be useful over the internet.
However, one must be aware that there is no rule as such regarding the usage of a particular hosting technique in any particular situation. With experience, the developer will be the best judge.
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
Is there any alternative to IIS/ASP.Net/ASP while still being able to code in C# (for web back end development) ? Is there any light weight open source alternative to IIS,ASP.Net combo ?
Mono is the open source alternative Mono project
Have you tried the new IIS Express? It provides you with a configurable IIS 7.5 style platform per website solution. It's really useful when developing on XP for instance where previously you would have been limited to 1 website per development machine.
It's now available as part of the Visual Studio 2010 SP 1 download.
Check it out here;
IIS Express Overview
Although I'm a bit unclear as to your actual project requirements there is nothing stopping you from creating a C# based application and then exposing a web service which your application could connect to written in any web based language of your choice. However you will still have to host the web service in IIS.
You can use Cassini:
http://ultidev.com/products/Cassini/index.htm
Cassini is very reliable but not designed for heavy usage which is why UltiDev have built UWS Ultidev Web Server Pro based on the original Cassini Server:
http://ultidev.com/products/UWS/