Main Site Documentation

Web developer newbie advice


#1

If a not so competent .Net Micro C# programmer was looking for the quickest, most effective way to develop some simple web apps, what would you guys recommend?.

This isn’t for an embedded system, it would be developed on a desktop PC and hosted on some server somewhere in our company network or even on my desktop machine. It isn’t for access by anyone in the world, just for our lab group to get access to the status of instrumentation we have floating around in the ocean regardless of where we are physically located.

Is there a way to do this all in Visual Studio and C# ? I’ve heard the term ASP, does that apply? I just watched while someone in my lab developed a fairly simple web app using Python and it looked incredibly complicated. He had to integrate Python stuff, HTML stuff and a bunch of other intimidating stuff. I’m hoping for something simpler.

Thanks


#2

You can use ASP.NET and program it in C#. It’s less complicated than most other methods. Google up a beginners tutorial. The same language syntax that you learned doing .net micro applies to ASP.NET.


#3

Take a look at Xojo.com

Uses Basic language. I have developed some fairly complex web applications with zero html and css.


#4

Thanks, I’ll start with ASP since it seems free and built in to VS.


#5

So I’ve gone through a couple of very simple Microsoft tutorials and have one question. Isn’t there an “approved” way to build a web page with the built in Visual Studio toolbox components like buttons, charts and text boxes?


#6

The “approved” way would be MVVC <= which is a more advanced topic. If you’re talking about UI frameworks; that’s a whole different ball game.


#7

@Mr_John_Smith

First of all thanks for your quick and useful responses, I appreciate them. All I’m really trying to do is make some of my C# desktop apps available to a few users over the web. We have a whole group of developers who create public web pages for our company ( www.mbari.org ), but they do very sophisticated stuff using pretty complex tools that I just don’t have the time, or to be honest interest, in learning. So, I’m just looking for the easiest way to create the same kind of desktop app I’ve been creating for years with pretty much the same Visual Studio tools and have it accessible by someone with a browser and an internet connection. If you know of a way to do this, I’d very much like to hear it.


#8

Long story short, there is no easy way to do that. Web development is hard and remains hard, due to the lack o being able to attach a debugger to the running web browser to test the application end to end. To date our profession has tried ActiveX, Java Applets, Flash, Silverlight and now Web Assembly; still the development is twice or more difficult as developing a desktop app on windows. In my opinion Silverlight was the closest that we got to making it just as easy.


#9

How about using remote desktop with a desktop application? Easy solution for one user at a time.


#10

I’m positive I have no valuable input to the question at hand, but want to know…

to make it meaningful, can you just give a more contextual example? Are you talking about building a whole UI framework in a browser, or do you have simple inputs and outputs that would be simple to represent on a webpage. Can you point to a web-based example that is something like as complex as you want?


#11

Here’s a typical app. It has a bunch of text boxes that display data, some boxes are grouped in a tab control and some tab pages may have a couple of charts.


#12

I’d recommend Dot.Net Core.
With a single install of the SDK, you have everything you need to start building Web Apps, Web API’s, Console Apps and much more! (With the new version 3.x they are even getting WPF/Win forms Windows apps) and all familiar C# and .net frame work type API (which full frame work and core are slowly becoming a ‘standard’)

The same code will also run on hardware x86/AMD64/arm23/arm64 in Windows or Linux (yes Rasbian too!)
Basically you go to command line and type ‘dotnet new mvc’ and bang you get a working MVC web site running in seconds. (and then can start building it out & learning the framework, but should be pretty familiar)

Im using it to do something similar to what your suggesting. Ive got Core code running inside data loggers out in remote sites. Logging data. When onsite, Techs use a local dotnet core web API & website to monitor real time data from the loggers. Another one remote controls a ‘Remote Controlled Floating Data Logger’, plots real time data (CRO type signal graph plots) and heatmaps / vector diagrams, heading direction etc etc.
RF Lora Radio for long distance (working on that now) &/or Wifi comms. (using SignalR at the moment) for Live Telemetry. This local ‘web site’ runs on one of the field laptops but then multiple techs can connect to it and share the same data and also monitor the remote controlled logger.

Since its all dotnet core, some of the SAME libraries Ive written are running on Laptops/Desktops/RasberryPi’s (yes can get GPIO access) and also data processing in the cloud (Azure)

Using dotnet core 2.X has been very very productive for me over last 2 years!! and v3 now incorporates much of what I need into one framework.
Hope one day to also use TinyCLR into the mix too!!! As can see a use case there!

Happy to go into more details and disc if you DM me.

Regards,

Paul


#13

@Gene, There are other ways to give people access without resorting to html. Can you just send them the application? Or does the app require a centralized database? Also, if the app becomes multi user, how are they going to authenticate?


#14

All right, you guys convinced me to give the full blown Microsoft path to web happiness a try. I downloaded VS2017 and ASP.Net just like they describe on the Microsoft ASP web pages… Then I tried to follow this tutorial:

2 hours later, I finally got all the libraries and nuGet packages and SDKs at the right version so they were compatible enough that I could actually compile and run the first part of the tutorial. So that worked but when I try to run the next part of the tutorial that adds a new scaffolded model (whatever that is) I get this error

image

I found this on the web

but it throws errors also.

Writing C:\Users\gene\AppData\Local\Temp\tmp9687.tmp
info : Adding PackageReference for package ‘Microsoft.VisualStudio.Web.CodeGeneration.Design’ into project ‘C:\Users\gene\source\repos\RazorPagesMovie\RazorPagesMovie\RazorPagesMovie.csproj’.
log : Restoring packages for C:\Users\gene\source\repos\RazorPagesMovie\RazorPagesMovie\RazorPagesMovie.csproj…
error: Unable to find package Microsoft.VisualStudio.Web.CodeGeneration.Design. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
error: Package ‘Microsoft.VisualStudio.Web.CodeGeneration.Design’ is incompatible with ‘all’ frameworks in project ‘C:\Users\gene\source\repos\RazorPagesMovie\RazorPagesMovie\RazorPagesMovie.csproj’.

I don’t really understand how to add packages or use nuGet so I’m pretty lost at this point. Suggestions would be greatly appreciated.

Thanks


#15

lol!! ahhh the joy of tech, haven’t we all been here!!

Im sure this seems like a case of VS up to date after a fresh install + some SDK and package dependency versioning issues.
Very much sounds like VS tooling issues which happens when VS is not at the ‘expected’ level the SDK was targeted at.

Have you checked after fresh install VS is at 15.9? As in pre-req

Visual Studio 2017 version 15.9 or later with the ASP.NET and web development** workload
.NET Core SDK 2.2 or later

Happy to help but do you have another means of comm and back and forth here will be very slow!
MS Teams/Slack ?


#16

My VS is at 15.9. I’m going to try a clean install tomorrow at work where we have a blazing fast internet connection and Slack. I’ll take you up on your offer when I get desperate.


#17

XAre you sure you have installed correctly last release netcore 2.2 sdk? Probably sdks are messed up and project template is creating erroneous reference…
I use net core all the day and no issue (also creating webapi for a raspberry)


#18

Good news: I already had VS 2017 on my work desktop and after updating to the latest version and with only a minimum of fooling around, I was able to run the tutorial. Major progress. I ran the dotnet --info command and will compare the results to my home machine to see what’s different. I’m still pretty intimidated by the amount of information you need to understand ASP and web development in general but at least I’ve got plenty of light reading for the future.

Thanks for all the help.


#19

You can find tons of tutorial on the internet about asp.net core, mvc, webapi… but, yes, it is often very confusing…