CoreCompact.System.Drawing implementation - c#

I know I'm being thick but I am having trouble implementing a new 'using' directory for my .NET Core project.
I have downloaded the necessary files for CoreCompact.System.Drawing (https://github.com/CoreCompat/CoreCompat)
I simply have no idea how to implement the folders so that I can start using this directory and subsequently use the system.drawing objects that are not supported in Core projects.
I am new to ASP.Net but have been studying C# for long enough that I don't need too detailed a guide.

There's no need to use CoreCompat.System.Drawing anymore. In fact, the author says you shouldn't. The reason? Microsoft provides an official System.Drawing.Common NuGet package now.
To install:
Select the Tools menu
NuGet package manager
Manage NuGet packages for solution
Click Browse tab
Search for System.Drawing.Common
Select the Microsoft package
Tick/check your project on the right-hand panel.
Click Install
Agree to the licence agreement.

You may need to add it as a reference to your project first. Do this by right clicking on the "References" file in your solution, and click add reference. Then press the "Browse..." Button in the bottom right of the pop up window and navigate to the desired DLL.

Related

Visual Studio References versus Dependencies, Assemblies, and Packages

In Visual Studio 2019, in a .NET Framework (not .NET Core) console application project, how do I add NuGet packages so that they show up in the "Packages" section of a "Dependencies" instead of just as "References" with other assemblies? That is, I'd like to get this (which is from a Microsoft example app)...
... instead of this (which is what I have in my app after adding Newtonsoft.Json and MSAL using the NuGet package manager tool) ...
Notice, in my app, there is a "References" section but no "Dependencies" section, and the packages are mashed in with the other references. The only thing I could find to try was to right-click on References then select the "Migrate packages.config to PackagesReference", which yielded this ...
(StackOverflow bug? When I try to add a third image, it shows some totally random image in a different language. What the picture shows, though I can't get it to add, is the same "References" section except that the Json and MSAL references have a different icon.)
... which is closer (the packages are now "references", I guess) but there is still no Dependencies section with partitioned Assemblies and Packages subsections.
Assuming the MS example is doing it "right" and that I am doing it "wrong", how do I get from where I am to where they are?
Ah! I think I found the answer at Visual Studio 2017 References vs Dependencies. It appears I need to use a different project type if I want the newer style project file.

Is it possible to install the MaterialDesignThemes package once and be able to reference it on each and every other wpf project?

I am new in WPF application development and I came across the Material Design package, I am using Visual Studio 2015 Enterprise.
Every time I want to create a new WPF application I always go to
Project -> Manage NuGet Packages and install the MaterialDesignThemes package for that specific project and when I am working on another project I need to do the same process again.
Is possible to only install this package once and somehow use it (or reference it) on all projects that I am creating as opposed to installing it with each and every new project I create?
I hope my question makes sense and I am asking this for the sake of being able to develop new material design WPF applications offline.
They ask to use nugget to keep the package updated that way you can check versions and so on. But you can download the source code from GitHub and keep it on your machine or server you use it for. That way you can refer it from your machine and don’t need to download for every project you work.
Project source: https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/releases
In my opinion, I highly recommend download from nugget repository because it is easy to maintain and anyone else that code and the same project will find the package over there.
Create a Project Template.
VS2015: https://msdn.microsoft.com/en-us/library/xkh1wxd8.aspx
VS2017: https://learn.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates
Another way of quickly installing nuget packages is using the Package Manager Console and use the install-package command. e.g. install-package materialdesignthemes

Install Bot framework with nuget

I see in the documentation I must download a Template to use the bot Framework https://learn.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-quickstart
There is a way to install this tempalte with nuget ? I find the package for nuget https://www.nuget.org/packages/Microsoft.Bot.Builder/
But I must create a project to use the cmd Install-Package
How install the bot framewokr only with nuget ?
The documentation article, which you are referring to, does not say you have to install any framework. What it recommends is to install the project template. Project templates are not frameworks, they just have some pre-included files.
The same documentation article clearly says that the framework itself is a nuget package. They say:
By using the Bot Application template, you're creating a project that already contains all of the components that are required to build a simple bot, including a reference to the Bot Builder SDK for .NET, Microsoft.Bot.Builder. Verify that your project references the latest version of the SDK:
Right-click on the project and select Manage NuGet Packages.
In the Browse tab, type "Microsoft.Bot.Builder".
Locate the Microsoft.Bot.Builder package in the list of search
results, and click the Update button for that package.
Follow the prompts to accept the changes and update the package.
Thanks to the Bot Application template, your project contains all of the code that's necessary to create the bot in this tutorial. You won't actually need to write any additional code. However, before we move on to testing your bot, take a quick look at some of the code that the Bot Application template provided.
This basically means that there is no requirement to have this project template. What you can do is actually install the template, create a project and look at the project structure and packages. Then, you are free to reproduce the same project structure and add necessary references yourself, without using project template.
Again, the template is just a bootstrap code.

How to use the NuGet packages.config file?

I see a packages.config file for each of my projects in a solution. It contains info about various assemblies info. I am expecting that the NuGet will automatically scan these packages.config and download as necessary. But it didn't. Do I need to manually install all the packages?
If you right click the project in question you can select "Manage nuGet Packages" from the menu. After you do that you can click "installed packages" on the left hand side to see the packages that you currently have installed. These are what you are seeing in your "packages.config" file. If you wish to update the packages or reinstall them you can do that through the interface here by clicking "uninstall", then finding them in the list an re-installing them again.
Alternatively you can use the package manager console to do things like updating, installing older versions or all sorts of things with the nuget manager. See here for some details about that. (Information about updating a package is at the bottom of the page).
Best of luck!

How to use NuGet?

I have installed NuGet, how to use it?
I saw the video and i tried
>Add-Package log4j
Command "Add" is not valid.
>
it does not work, I entered that in Command Window.
EDIT:
I uses VS2010 and I build WindowsForm App and not ASP.NET.
You've got two options;
You can either use the GUI; right click on project references > Add Library Package Reference...
Or you can use the console, which has more features, but I'd not recommend it.
You're entering this in the Command window when you should be entering it in the Package Manager Console window. Open it through 'View' / 'Other windows' / 'Package Manager Console'.
To answer your specific question besides the documentation link:
Using the Package Manager Console you can find a package by filtering it i.e.:
get-package -remote -filter Log4net
Once you find the package you want, you can add it to your project with
install-package log4net
That's all there is to it - if you don't need to use the console then for casual use the Add Library Package Reference Dialog Box (that's a handful) provides an easy to use UI to add packages.
Click on project --> Manage nuget packages.
You can see this youtube video which shows the importance of Nuget and how to use by using VS 2012
http://www.youtube.com/watch?v=AXfZsTj-7P0
If you have visual studio 2013 or above.. the solutions now come up with Nuget package manager and a packages.config file is also added to the solution. packages.config file contains information about all the packages present in the solution.
Read more > About Nuget Install/Uninstall & Downgrading

Categories