Må ha support for C# utvikling installert i VSCODE. Hvis det er et eldre prosjekt som man henter opp som er laget i Visual Studio så må man ha C# Dev kit installert siden det støtter MSBUILD projects osv.
https://code.visualstudio.com/docs/languages/csharp
###
Må sjekke at ikke det er feil versjon av dotnet som kjøres med kommando dotnet --info
Installering i et CMD vindu kan skje med winget: https://learn.microsoft.com/en-us/dotnet/core/install/windows?tabs=net70
###
X86 path kan være fær X64 path. Rekkefølgen på path prioriteres
Sjekk PATH ! IKke bare PATH for ALLE brukere, men sjekk path for DIN bruker
https://github.com/dotnet/core/issues/5962#issuecomment-780084535 MRK denne tutorialen fokuserer på SYSTEM PATH men det var YOUR ACCOUNT PATH som var feil
Hvis path peker til x86 versjonen av dotnet mens du har installert dev packs osv for X64 versjonen av dotnet så får du feilmeldinger i VSCODE
Må ha core dev installert
List hva som er installert med "dotnet --list-sdks"
###
Må modde .csproj fila i det opprinnelige prosjektet for å få kopmpilert med VSCODE
https://github.com/dotnet/msbuild/issues/5787
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
</Project>
###
Måtte konvertere .csprj fila til nytt format som VSCODE ville godta (fikk build feilmelding)
Brukte dette toolet på kommandolinje: https://treit.github.io/c%23,/programming/2019/02/18/ConvertingCsProjectsToNewSdkFormat.html
dotnet tool install --global Project2015To2017.Migrate2017.Tool
conv HelloWorld.csproj
Litt mer info om konvertering til nytt CSPROJ format: https://www.hanselman.com/blog/upgrading-an-existing-net-project-files-to-the-lean-new-csproj-format-from-net-core
Tag: Visual Studio
How to develop and debug C++ code for Arduino in Visual Studio if you are tired of the Arduino IDE
The Arduino platform has gained a fantastic popularity over the past ten years. For small quick and dirty projects, the .ino files and the standard IDE is OK. However, for professional development projects and for developers that want control over the .hpp and .cpp files the standard Arduino IDE is somewhat regarded like a toy. Furthermore there is no proper debugger in the Arduino IDE (whaaat?, you gotta be kidding?)
Well, this has changed as Visual Micro has developed a plugin to Microsoft Visual Studio. You can write code the normal way you do it with .cpp and .hpp files. You can also run the GDB debugger. The IDE has support for the regular .INO files and Arduino libraries. Here is how both .cpp and .ino files are handled: http://www.visualmicro.com/page/User-Guide.aspx?doc=INOs-and-CPPs.html
There is a free version of Visual Micro and it works against the free versions of Microsoft Visual Studio 2017 Community Edition. All you need is a Microsoft account to be able to download and install Visual Studio 2017 Community edition. Then in MSVC 2017, go to tools, Extensions and Updates and enter a search for Arduino in the search bar. It will will offer to automatically install the Arduino tools and the GDB debugger. Click install and you are on the right path.
If you find this tip useful, please share on facebook and share the link. Also, feel free to report your experiences in the comment field.