Install Aspose.Diagram using NuGet and Create Microsoft Visio Document in Visual Studio
Tags: nuget, visualstudio, visio, diagram
Published: 2018-09-27 09:55:11

---
title: Install Aspose.Diagram using NuGet and Create Microsoft Visio Document in Visual Studio
published: true
description: Install Aspose.Diagram using NuGet and Create Microsoft Visio Document in Visual Studio
tags: #Nuget, #Visual Studio, #Visio, #Diagram
---

[Aspose.Diagram](https://products.aspose.com/diagram) API helps developers to work with Microsoft Visio files. They can create, manipulate and convert Visio file formats in their applications without any need to install Microsoft Visio. Aspose.Diagram is a light-weight API and suitable for both client side and server side use. The API is extensible, easy to use, compact and provides common functionality so that developers have to write less code when performing common tasks.

**Supported Platforms**

>Aspose.Diagram supports both .NET and Java platforms. Please see [Aspose.Diagram for .NET](https://products.aspose.com/diagram/net) and [Aspose.Diagram for Java](https://products.aspose.com/diagram/java) for your reference.

**Article Description**

>In this article, we will install Aspose.Diagram using NuGet and create a Microsoft Visio document using it in Visual Studio.

# Aspose.Diagram NuGet Download Link

You can always find the most recent version or earlier versions of Aspose.Diagram from the following NuGet link. Please see its snapshot given below.

* https://www.nuget.org/packages/Aspose.Diagram/

![Snapshot of Aspose.Diagram NuGet Download Link.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Snapshot-of-Aspose.Diagram-NuGet-Download-Link.png "Snapshot of Aspose.Diagram NuGet Download Link.")


# Install Aspose.Diagram using NuGet Pacakage Manager in Visual Studio

In this section, we will create a console application project and install Aspose.Diagram using NuGet Package Manager. We will illustrate all the steps involved with screenshots for your ease.

## Create Console Application Project

* Open Visual Studio. The following screenshot shows Visual Studio 2017 but you can use any Visual Studio.

![Open Visual Studio 2017 or any other.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Open-Visual-Studio-2017-or-any-other.png "Open Visual Studio 2017 or any other.")

* Click _New > Project_.

![Click New > Project.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Click-New-Project.png "Click New > Project.")

* Select _Console App (.NET Framework)_ and give it name _TestAsposeDiagram_ and then click _OK_.

![Select Console App (.NET Framework) and give it name TestAsposeDiagram.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Select-Console-App-(.NET-Framework).png "Select Console App (.NET Framework) and give it name TestAsposeDiagram.")

* _Console Application Project_ named _TestAsposeDiagram_ will be created in Visual Studio.

![TestAsposeDiagram console application project created.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/TestAsposeDiagram-console-application-project-created.png "TestAsposeDiagram console application project created.")

## Install Aspose.Diagram using NuGet Pacakage Manager

* Right click the project inside the _Solution Explorer_ and click _Manage NuGet Packages…_

![Click Manage NuGet Packages inside the Solution Explorer.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Click-Manage-NuGet-Packages-inside-the-Solution-Explorer.png "Click Manage NuGet Packages inside the Solution Explorer.")

* Click _Browse_, type _Aspose.Diagram_, you will see Aspose.Diagram listed, select it and click _Install_ button.

![Click Install button when Aspose.Diagram is listed in the NuGet Packages.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Click-Install-Aspose.Diagram-listed-in-NuGet-Packages.png "Click Install button when Aspose.Diagram is listed in the NuGet Packages.")

* _Preview Changes_ dialog box will appear. Click OK.

![Preview Changes dialog box will appear. Click OK.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Preview-Changes-dialog-box-will-appear-Click-OK.png "Preview Changes dialog box will appear. Click OK.")

* _License Acceptance_ dialog box will appear. You can view the license and accept it to proceed further.

![License Acceptance dialog box appears, please view and accept the license of Aspose.Diagram.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/License-Acceptance-dialog-accept-license-Aspose.Diagram.png "License Acceptance dialog box appears, please view and accept the license of Aspose.Diagram.")

* _NuGet Pacakage Manager_ installs Aspose.Diagram and shows the progress information in _Output_ window.

![NuGet Package Manager installs Aspose.Diagram and shows progress in Output window.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/NuGet-installs-Aspose.Diagram-shows-progress-Output-window.png "NuGet Package Manager installs Aspose.Diagram and shows progress in Output window.")

* On viewing _References_ in _Solution Explorer_, you will find, _Aspose.Diagram_ is present there as shown in this screenshot.

![Aspose.Diagram is present inside References in Solution Explorer.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Aspose.Diagram-present-in-References-in-Solution-Explorer.png "Aspose.Diagram is present inside References in Solution Explorer.")

* Hover your mouse pointer on _Path_ inside the _Aspose.Diagram Reference Properties_ to find the path of DLL and check the _Version_ number.

![Path and Version of Aspose.Diagram shown inside assembly Properties inside the Solution Explorer.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Path-Version-Aspose.Diagram-Properties-Solution-Explorer.png "Path and Version of Aspose.Diagram shown inside assembly Properties inside the Solution Explorer.")

* View _packages.config_ file that displays the Aspose.Diagram NuGet package and its version. You can modify it later on to try other versions of Aspose.Diagram.

![View packages.config file that displays the Aspose.Diagram NuGet package and its version.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/View-packages.config-displays-Aspose.Diagram-NuGet-package.png "View packages.config file that displays the Aspose.Diagram NuGet package and its version.")

# Create Microsoft Visio Document using Aspose.Diagram

* Please first add the following **C# Using Directive**.

```csharp
using Aspose.Diagram;
```
* Now add the following **C# code** in the _Main_ method and then press _F5_ or _Ctrl + F5_ to run it.

>The code creates object of _Aspose.Diagram.Diagram_ class and just saves it as _OutputByAsposeDiagram.vsdx_. Please note, _VSDX_ is the Microsoft Visio format that represents XOPC/XML drawing.

{% gist https://gist.github.com/AsposeDiagram/28f6aa828fd553d50dd6a03c611c92cd %}

* The following screenshot shows the _Complete Sample Code_ inside the _Visual Studio Console Application Project_ for your reference.

![Sample Code to Create Microsoft Visio Document using Aspose.Diagram.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Code-Create-Microsoft-Visio-Document-Aspose.Diagram.png "Sample Code to Create Microsoft Visio Document using Aspose.Diagram.")

# Output Microsoft Visio Document using Aspose.Diagram

* After the successful execution of the code, [_OutputByAsposeDiagram.vsdx_](https://github.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/blob/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/OutputByAsposeDiagram.vsdx) document will be created inside the output directory.

![OutputByAsposeDiagram.vsdx created by Aspose.Diagram.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Output-Directory-OutputByAsposeDiagram.vsdx-Aspose.Diagram.png "OutputByAsposeDiagram.vsdx created by Aspose.Diagram.")


* Double click the _OutputByAsposeDiagram.vsdx_ to open it in **Microsoft Visio**.

>As you can see in screenshot, the [output Microsoft Visio document](https://github.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/blob/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/OutputByAsposeDiagram.vsdx) is empty and only showing **Evaluation Warning** message. It is because we have not set license for Aspose.Diagram. Once, you will set the license, this warning will disappear. Please see the document [Aspose.Diagram Licensing](https://docs.aspose.com/display/diagramnet/Licensing) for more information about it.

![Output VSDX created by Aspose.Diagram showing the Evaluation Warning message.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Install-Aspose.Diagram-using-NuGet-and-Create-Microsoft-Visio-Document-in-Visual-Studio/Output-VSDX-Aspose.Diagram-Evaluation-Warning-message.png "Output VSDX created by Aspose.Diagram showing the Evaluation Warning message.")

# See also

* [Manipulate Microsoft Visio file format programmatically in C#](https://medium.com/asposediagram/manipulate-microsoft-visio-file-format-programmatically-in-c-84163b579169)
* [Working with Microsoft Visio Shapes](https://docs.aspose.com/display/diagramnet/Working+with+Shapes)
* [Forum - Aspose.Diagram Product Family](https://forum.aspose.com/c/diagram)