C# and Visual Studio Community - Page 1
Forum section: electronics / general

author: PerranOak
author_rank: Frequent Contributor
timestamp: June 05, 2020, 04:21:31 pm
content: My training manual (for PICs) is saying that I should download "Visual Studio Community" in order to use C#.I have been recommended this before but have not yet looked at it.May I ask a few questions:1. Is it safe, I mean in terms of general Internet security (I hate downloading stuff I don't understand)?2. Do I have to have a Microsoft account and if so what does this entail, i.e. does it constrain me in anyway?3. Does it download a lot of stuff or can I just have C# (I can't use cloud versions of stuff as my Internet connection is slow and dodgy)?Thank you.

author: JPortici
author_rank: Super Contributor
timestamp: June 05, 2020, 04:36:31 pm
content: 1)yes2)yes3)no, you can only download C# but be careful of the boxes that are ticked before starting download.What are you doing with PICs that require C#? I suppose GUIs for programs..Which training manual is it?

author: PerranOak
author_rank: Frequent Contributor
timestamp: June 06, 2020, 09:27:55 am
content: Cheers.It's a series of four manuals and a programmer, etc. by Peter Brunning. I am on book 3 and I think C# is used for serial comms with the PC somehow.

author: Lindley
author_rank: Regular Contributor
timestamp: June 06, 2020, 10:13:47 am
content: Hi,C# is needed to allow you to create code for the PC to communicate with the Pics."Experimenting with Serial Communications teaches Visual C# programming for the PC (not PIC) so that we can create PC programmes to control PIC circuits."It could be very useful to learn as so many micros now talk to the PC via serial or wifi/bt.You need to have or create a Microsoft account, (if you do not already have one to log on to Windows?) as Visual Studio is Microsofts property.Not often you see folk using these older style Pic training boards these days, not cheap at that price, though not saying its in any way a bad course.Many will say you should not bother with Pics or Assembly code, but we started with them and its a great way to really understand how they work, and fun !

author: PerranOak
author_rank: Frequent Contributor
timestamp: June 07, 2020, 10:29:05 am
content: Thank you.I have downloaded Visual Studio Community and signed-up for the Microsoft Account.I selected "create a new project" then went through the menus first selecting “C#” under “All languages”.Then there is, “All platforms” with options:AndroidAzureiOSLinuxmacOStvOSWindowsXboxI selected “Windows” as I'm using Windows(!)Then there is, “All project types” with options:CloudconsoledesktopextensionsgamesIOTlibrarymachine learningmobileofficeotherservicetestUWPWebBut whichever one of these I selected I had nothing to click on and “Next” was greyed out.Is it to do with what I downloaded under Visual Studio? I only downloaded:Compiler, build tools, and runtimes:C# and Visual Basic Roslyn compilersDevelopment activities:C# and Visual BasicThere is another thing I noticed called, “.NET desktop development” (screen capture attached). Is this what I should download?

author: Mr Evil
author_rank: Regular Contributor
timestamp: June 07, 2020, 04:02:18 pm
content: Quote from: PerranOak on June 05, 2020, 04:21:31 pmDespite what previous posters have said, you don't need a Microsoft account. I'm using Visual Studio Community right now without one, on an installation of Windows that only has a local acocunt.Quote from: PerranOak on June 07, 2020, 10:29:05 amIf you want to write an application that runs on Windows, whether a console app or with a GUI, then that is the one you want.

author: JPortici
author_rank: Super Contributor
timestamp: June 07, 2020, 05:57:52 pm
content: really? i had to make one otherwise community would stop working after 30 days

author: Mr Evil
author_rank: Regular Contributor
timestamp: June 07, 2020, 07:17:23 pm
content: Quote from: JPortici on June 07, 2020, 05:57:52 pmYou're right. I forgot about the 30 day thing as I usually install VS on a fresh VM when I need it, so I rarely pass the limit. On the one machine where it's permanantly installed, I had to sign in with an account.

author: brucehoult
author_rank: Super Contributor
timestamp: June 07, 2020, 11:30:25 pm
content: If the course you're following uses C# then life will be more straightforward if you get that, but be aware that if all you want to do is write programs to communicate with a microcontroller via a serial port (USB serial these) days then you can do that with a shell script / batch file, python or any other programming language that allows you to open and read/write "files".

author: PlainName
author_rank: Super Contributor
timestamp: June 08, 2020, 12:19:13 pm
content: There is an alternative IDE to the Microsoft thing:https://sourceforge.net/projects/sharpdevelop/Don't know how good it is and it seems to have just gone into hibernation, but you don't need a Microsoft account.

author: PerranOak
author_rank: Frequent Contributor
timestamp: June 08, 2020, 05:21:12 pm
content: Cheers all.I've plumped for VS and have taken out an MS account.It seems to be going well though my ancient laptop struggles a bit.

author: Lindley
author_rank: Regular Contributor
timestamp: June 09, 2020, 08:21:09 am
content: Though the OP is using C# for the course they are doing, is C# the best /easiest code to start with ?Looking to do this ourselves, but wonder if Visual Basic or C## might be easier to start with, seems plenty of ytubes tutorial on Basic ?

author: PerranOak
author_rank: Frequent Contributor
timestamp: June 09, 2020, 08:45:48 am
content: Maybe but my “training manuals” use it so ...In fact, I seem to be getting on quite well with it and it seems a logical progression from C.

author: bd139
author_rank: Super Contributor
timestamp: June 09, 2020, 09:36:06 am
content: Use C#. Every time they release another .Net / Core version they try and kill Visual Basic. One day they will succeed.Keep going with C#. It's productive, the tools are decent and it'll serve you well. I've been using it for 17 years now. The main product I work on is ~ 3 million lines of it (that's after stripping comments and whitespace)The only thing is it's a pretty wild ride. Lots of things get smashed and deprecated. Look at targeting .Net 5 rather than older versions if you can.On original questions:1. It is perfectly safe to download.2. the Microsoft account is used just to check you are not a business user signing in and using community for nothing.3. You can just take C# and the IDE. You might want to install the web / desktop app tooling as well for convenience.If you're not happy signing up for an MS account you can use VScode which is a total reimplementation of Visual Studio from here:https://code.visualstudio.com/This is somewhat newer and less powerful than traditional visual studio for C# but an excellent general purpose IDE (I use it for most things TBH)

author: JPortici
author_rank: Super Contributor
timestamp: June 09, 2020, 11:24:20 am
content: Quote from: PerranOak on June 09, 2020, 08:45:48 amwhich is the reason why i didn't suggest alternatives before.I do not use C# anymore, because i want to keep thinking like i'm doing C (to paraphrase someone who had very good points in the "why are you still using C thread") so i put more effort and started using C++ and Qt (a good starting book IMHO is the beaglebone black book by derek molloy, helped me way more than any other tutorial to get started in QTBut i digress. Use C#, Make sure the examples are working and start from there to make your own thing.