Cross-Platform: dotnet core web api QR Codes
-
I found a very cool library for creating QR Codes[^] from text input. I decided I wanted to create a DotNet Core (3.1) WebAPI so I could see some (or all) of the QRCoder functionality in action. However, I run Linux (Ubuntu) exclusively at home and Win10 at work. The Premise I wanted to know if I could create a DotNet Core project (using Visual Studio Code) that I could later 1) clone from GitHub (to my Linux box), 2) build and 3) run. Visual Studio Code Since it runs on both Win10 and Linux I knew I needed to use Visual Studio Code (instead of plain old Visual Studio). Of course, that also meant I'd need to run dotnet core command line. I gen'd up a Web API project on the command line following this tutorial[^]. Basically just :
/> dotnet new webapi -o /> cd
Then I was able to add the QRCode library from nuget via:
/> dotnet add package QRCoder --version 1.3.6
There was bit of a problem when I went to build, because even though I have dotnet 3.1 installed the qrcoder had a dependency on a newer system.drawing.common. Luckily at Nuget you can click the dependencies tab and see how to get that newer library like:
/> dotnet add package System.Drawing.Common --version 4.7.0
After that, everything built and worked. I added some URLs that allows the user to generate QRCodes as JPGs or as Ascii Text (see below). Ok, ok, but what about Linux!?! Building and Running On Linux I went home, pulled my GitHub repo for the project[^] made sure my dotnet core installation was up to 3.1 and ran: /> git clone href="https://github.com/raddevus/QRCodeGen" /> cd QRCodeGen /> dotnet restore -- restores all required libraries for project /> dotnet build /> dotnet run The web api app started running on localhost:5001 and I made calls into the QRCoder API. This is where the cross-platform pa
-
I found a very cool library for creating QR Codes[^] from text input. I decided I wanted to create a DotNet Core (3.1) WebAPI so I could see some (or all) of the QRCoder functionality in action. However, I run Linux (Ubuntu) exclusively at home and Win10 at work. The Premise I wanted to know if I could create a DotNet Core project (using Visual Studio Code) that I could later 1) clone from GitHub (to my Linux box), 2) build and 3) run. Visual Studio Code Since it runs on both Win10 and Linux I knew I needed to use Visual Studio Code (instead of plain old Visual Studio). Of course, that also meant I'd need to run dotnet core command line. I gen'd up a Web API project on the command line following this tutorial[^]. Basically just :
/> dotnet new webapi -o /> cd
Then I was able to add the QRCode library from nuget via:
/> dotnet add package QRCoder --version 1.3.6
There was bit of a problem when I went to build, because even though I have dotnet 3.1 installed the qrcoder had a dependency on a newer system.drawing.common. Luckily at Nuget you can click the dependencies tab and see how to get that newer library like:
/> dotnet add package System.Drawing.Common --version 4.7.0
After that, everything built and worked. I added some URLs that allows the user to generate QRCodes as JPGs or as Ascii Text (see below). Ok, ok, but what about Linux!?! Building and Running On Linux I went home, pulled my GitHub repo for the project[^] made sure my dotnet core installation was up to 3.1 and ran: /> git clone href="https://github.com/raddevus/QRCodeGen" /> cd QRCodeGen /> dotnet restore -- restores all required libraries for project /> dotnet build /> dotnet run The web api app started running on localhost:5001 and I made calls into the QRCoder API. This is where the cross-platform pa
Hard .Core again :-\
-
I found a very cool library for creating QR Codes[^] from text input. I decided I wanted to create a DotNet Core (3.1) WebAPI so I could see some (or all) of the QRCoder functionality in action. However, I run Linux (Ubuntu) exclusively at home and Win10 at work. The Premise I wanted to know if I could create a DotNet Core project (using Visual Studio Code) that I could later 1) clone from GitHub (to my Linux box), 2) build and 3) run. Visual Studio Code Since it runs on both Win10 and Linux I knew I needed to use Visual Studio Code (instead of plain old Visual Studio). Of course, that also meant I'd need to run dotnet core command line. I gen'd up a Web API project on the command line following this tutorial[^]. Basically just :
/> dotnet new webapi -o /> cd
Then I was able to add the QRCode library from nuget via:
/> dotnet add package QRCoder --version 1.3.6
There was bit of a problem when I went to build, because even though I have dotnet 3.1 installed the qrcoder had a dependency on a newer system.drawing.common. Luckily at Nuget you can click the dependencies tab and see how to get that newer library like:
/> dotnet add package System.Drawing.Common --version 4.7.0
After that, everything built and worked. I added some URLs that allows the user to generate QRCodes as JPGs or as Ascii Text (see below). Ok, ok, but what about Linux!?! Building and Running On Linux I went home, pulled my GitHub repo for the project[^] made sure my dotnet core installation was up to 3.1 and ran: /> git clone href="https://github.com/raddevus/QRCodeGen" /> cd QRCodeGen /> dotnet restore -- restores all required libraries for project /> dotnet build /> dotnet run The web api app started running on localhost:5001 and I made calls into the QRCoder API. This is where the cross-platform pa
Look here[^] There’s a library you can install to enable System.Drawing on Linux.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
Look here[^] There’s a library you can install to enable System.Drawing on Linux.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???