I want to run an simple web application on my industrial PC (based on raspberrypi) and host it on LAN. The purpose of the web application is that there is some kind of interface for the PC via WiFi. The PC has Debian OS running (without a graphical interface).
I made the ASP.NET Core Web Application on Windows with Visual studio 2019. When I run the application in visual studio, it all looks OK:
In order to run the app on Linux, I published the app (Self contained, Single File, linux-arm). On the PC I have configured some routes using iptables. I opened port 443 (HTTPS) and 80 (HTTP) to allow browser traffic through these ports. Both the ethernet and WiFi have a static IP. When I run the app, and browse to the page on another device via LAN the layout or something is all messed up. I don't know where to start because I have little to none experience with ASP.NET/ HTML / CSS.
I Also tried hosting it on Nginx, but i had the same result.
Can someone please help?:)
Related
I have no prior experience working in the .NET stack. Not sure if this is a common requirement. I have developed a simple .NET web service which accesses the COM library provided by a label printer SDK to send print jobs to the printer connected to my machine.
I need to distribute the web service to clients so that it can be hosted on their machines locally. Set up should be minimum - something like an installer which will do the needful to deploy the web service locally.
I assume that any windows machine comes with .NET bundled.
I understand that IIS is the windows equivalent of apache-tomcat. Does is it come bundled with all windows machines? If it does, I figure I can write some scripts to deploy the web service to IIS using the ".deploy" file generated by Visual Studio.
Are there any betters way of doing this ?
So my question is :
How do I distribute a web service that should be be hosted and run locally on the client's machine without forcing the user to download and install a web server and deploy the package?
Edit:
So, I gather IIS is not supported by home editions.
I have an unlimited Windows Hosting package on a Windows Server 2012. I wish to run a game server of some game which can run on windows hosts by executing an EXE file (that opens a Console, CMD-like window) - that means, if you want to run a server on your local computer you can simply run this application and use your internet's IP. I want to use my web address as an IP but however my question is: Can a Windows Server (2012) execute files?
Yes. With many *BUT*s and *IF*s. First of all nearly all hosting packages differs for purposes. If your hosting not game hosting hosting firm will not allow you using their processing power.
What would be the best (or easiest) way to setup a development environment in order to:
- develop iOS(iphone) application using Xcode in a MAC
- iphone app will be calling .NET web services written in C# (windows laptop)
- the database is MS SQLServer 2008 R2 (windows laptop)
I understand that I could do all this in my MAC if I was using PHP/MySQL but I really need the C#/MS SQL combo.
Thanks in advance.
Ceta
If you don't have access to a dedicated Windows environment for development, I would suggest that you install VMWare Fusion or Parallels on your Mac, and do your Windows development in a VM.
Can you not just deploy the Webservices (on the web?) and just test your API calls remotely?
Alternatively, network the machines so you can access the development copy, or use something like Parallels Desktop to run Windows inside your Mac environment. Related: Visual Studio on a Mac
If you have both machines up and running, XCODE, VS and SQL Server already installed, then I don't see the problem.
You only need to configure the special things in your Windows Machine so its perfectly suited for Web Services development. Skip the steps you may already have done.
1) Install IIS 6 / 7 (depends on your windows version)
2) Install ASP.NET
3) Turn off your firewall for Home network, or configure some permission for allowing inbound traffic to the HTTP/HTTPS ports.
4) Make sure you have an static IP address in your home network, or, make sure your machine name is DNS resolvable from your Mac.
You need IIS because Visual Studio internal web server doesn't allow remote connections.
Now, how can you debug your C# code if the Web Service is running in IIS? two options:
1) (easy) In the solution explorer, right click on your web project, choose properties, chose Web, in the section named "Servers" choose use local IIS WebServer and name your virtual folder. You'll be able to debug easily.
2) (medium) You can just publish your web app to your local IIS, make it run, and then from visual studio using the debug -> attach to process menu attach yourself to the w3wp.exe. The problem is, if you have several application pools, have fun finding your application.
I write the client app in iOS. I write the server side in WCF in Visual Studio. I use parallels to aces visual studio from my Mac. I run the service in IIS. Can I somehow acess the service from the iOS app. If I type http://127.0.0.1/ in internet explorer, it oppens IIS. But if I type http://127.0.0.1/ in safari, it doesn't recognize the address. How can I access the service from my iOS app?
127.0.0.1 is a local loopback address. You need to put your pc's local ip address in your safari browser use ipconfig in order to find it. In order to access the services through you ios app you need to use the NSMutableURLRequest from the iOS sdk.
I am having a C# based winforms or ASP.NET application deployed on my laptop which has to remotely connect to a windows service. The protocol mentioned in config file is TCP-IP as follows:
<wellknown url="tcp://LaptopMachineNAme:8085/MyService" type="MyController, MyOwn.AppTier" />
What would happen if the 'windows service' is also installed on my laptop?... Will the winforms or ASP.NET application be able to establish the "remote connection on the SAME machine"...???
There is no problem connecting to the service which is installed on the same computer. I would use named-pipes for this task, there is no problem having 2 (or more) bindings to the same service.
Doesn't even pass the FW IMO, when trying to connect to yourself...
I've done some projects that are using WinForms/ASP.NET combined with Windows Services on the same host - works perfectly fine
I've tested pretty many solutions having client and server working on the same machine. Should work. You can use localhost as machine name.