Template:PT3 CSHARP WIN VS 2: Difference between revisions

From Phidgets Support
(Created page with "<div class="phd-slide-deck" data-deck="PT3_CSHARP_WIN_VS_2"> <div class="phd-slide-deck-header"><h3>Visual Studio New Project</h3></div> <div class="phd-slides"> <div class="p...")
 
No edit summary
Line 5: Line 5:
<h2>Setting up a New Project</h2>
<h2>Setting up a New Project</h2>


<p>When you're building a project from scratch or adding Phidget code to an existing project, you need to properly link the Phidget .NET library.</p>
<p>Create a new project (a C# Console Application will be created for this example):</p>


<p>Create a new project (a Console Application will be created for this example):</p>
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/-x400/50/create.png"></div>
 
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/750x-/50/newproj1.jpg"></div>
</div>
</div>


Line 15: Line 13:
<h2>Setting up a New Project</h2>
<h2>Setting up a New Project</h2>


<p>Next, right-click on <b>References</b> in the solution explorer and choose <b>Add Reference</b>.</p>
<p>Next, right-click on <b>References</b> in the solution explorer and choose <b>Manage NuGet Packages</b>.</p>


<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/newproj2.jpg"></div>
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/refs.png"></div>
</div>
</div>


Line 23: Line 21:
<h2>Setting up a New Project</h2>
<h2>Setting up a New Project</h2>


<p>On the following screen, click <b>Browse...</b> and navigate to the location of Phidget22.NET.dll:</p>
<p>On the following screen, click the <b>Browse</b> tab and use the search bar to find Phidget22.NET.</p>


<div class="phd-command-line"><code>C:\Program Files\Phidgets\Phidget22\Phidget22.NET.dll</code></div>
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/nuget1.png"></div>
 
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/newproj3.jpg"></div>
</div>
</div>


Line 33: Line 29:
<h2>Setting up a New Project</h2>
<h2>Setting up a New Project</h2>


<p>Finally, to include the Phidget .NET library, add the following lines to main window class file:</p>
<p>Next, install the latest stable version Phidget22.NET</p>
 
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/nuget2.png"></div>


<pre data-syntax-language="csharp">
<p>Success! The project now has access to Phidgets. You can confirm it was installed properly by checking the References:</p>
using Phidget22;
using Phidget22.Events;</pre
>


<p>Success! The project now has access to Phidgets.</p>
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_CSHARP_WIN_VS_2/refs2.png"></div>
</div>
</div>



Revision as of 19:31, 3 January 2025

Setting up a New Project

Create a new project (a C# Console Application will be created for this example):

Setting up a New Project

Next, right-click on References in the solution explorer and choose Manage NuGet Packages.

Setting up a New Project

On the following screen, click the Browse tab and use the search bar to find Phidget22.NET.

Setting up a New Project

Next, install the latest stable version Phidget22.NET

Success! The project now has access to Phidgets. You can confirm it was installed properly by checking the References:

What's Next?

Now that you've set up Phidgets in your programming environment, you should read our guide on Phidget Programming Basics to learn the fundamentals of programming with Phidgets.

«
»