I've got a class library. I had created it with VS 2013 a few years ago. It has a References section where I can right click and Add Reference.
I just created a new c# class library in VS 2019 and References does not exist. It does have a Dependencies subgroup.
This seems like a newbie question but I can't find any suggestions of how to add Assembly References and can't think of what I'm missing.
Thanks for any help.
I just figured it out. I had created a .NET Standard Library vs. .NET Framework. I just created a new project, chose .NET Framework class library and now I see Reference.
If you right click on "Dependencies", there should be an option "Add Reference" - this will open the "References" window and you should be able to add packages, projects or .Net assemblies to the solution. They are then listed under "Dependencies".
Related
I am using Visual Studio 2017. I have a solution and in that solution I have 2 projects. One project is a library I made. This library is using Target Framework .Net Standard 1.6 and Output type: Class Library. The other project is a Windows Application using Target Framework: .Net Framework 4.6.1 and output type: Windows Application.
I added my class library to my windows application and the reference is in the Reference section, but when I try to use a class from the library, it cannot find it. Also I tried adding the "Using MyLibrary" and it still cannot find the reference. What else can I do?
I'm not sure why but the whole solution must had been corrupted or something. So I remade a whole new solution and created the projects again and copied all my files over and it worked. Not sure what the whole problem was but it is now working.
I am developing a console application in C# which requires some dll file to be referenced in Visual Studio Code(not Visual Studio!). There is no such option in menu I guess and I even tried Nuget package manager, but it does not worked for me. I cannot find any tutorial regarding this. Any experienced user?
You can use dotnet-add reference CLI command which provides a convenient option to add project references to a project.
Example: Add a project reference:
dotnet add app/app.csproj reference lib/lib.csproj
For more information, refer this.
I have a asp.net MVC 4 Application I'm working using visual Studio 2010.
I have added 3 Class libraries to the solution and for some reason only one of them is being picked up by visual studio.
So in any class where I reference the other in Using statement. I get the following error "The type or namespace name "*" does not exist in the namespace "MyProject"(are you missing an assembly reference?)"
I have right clicked on the main project, selected properties and checked that all the class libraries are listed under projects, which they are.
I have right clicked on the solution, selected properties and ProjectDependcies, and this is also set up correctly.
The class libraries are all listed in the References folder for the main Project.
I've tried cleaning and rebuilding , no joy any suggestions ??? Thanks
The DLLs are likely built using an later version of the framework than your project is targeting.
The version of .NET that your class libraries are targetting is greater than the version your application is targeting.
Either demote your libraries to use the version of .net targeted by your application, or promote your application to the version used by your libraries.
I am new to visual studio and was wondering how to setup visual studio 2010 so that I can reference my C# windows class library project? I currently have a solution with 2 projects - C# library project and a unit test project.
What is the best way to create multiple clients that will use this library? Should they be their own solution or just another project in the library solution? How do I use the classes in the library function from the project that references the library project?
You can add a reference to a library by doing a rightclick on the references node in the solution explorer and selecting the req. lib...
When all you consuming apps are located within the same solution I would prefer to place the lib also inside the sln, otherwise I would use an extra sln
Right click on the Client project "References" - > Add Reference
Go to the Projects tab if the class library is in the same solution. Else Browse and select the dll of the class library.
If Class library is not going to release as common dll for multiple projects, it's better to add them all to the same solution.
I wanted to try out some of the automation stuff available through BugSlayer, but am having problems with the references.
I'm trying to figure out how to reference the System.Windows.Automation library in visual studio. I have the .NET Framework v3.5 installed, and VS 2008, but neither the UIAutomationClient nor System.Windows.Automation appear as a reference option in either the .NET or COM tabs for the references.
I can see the dll if I navigate to C:\WINDOWS\assembly\GAC_MSIL\UIAutomationClient\3.0.0.0__31bf3856ad364e35 through the command prompt, but if I browse to the assembly in Visual Studio, I can't actually get to the dlls.
Have I overlooked a simple way to include this in my project?
The UIAutomationClient.dll is located in this folder:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0
If you can't find in your Add Reference->.Net tab, then you have to use the Browse tab to go to the given path, and add the assembly (Right Click on the References, choose add reference, click browse tab).
add Uiautomationclient dll present under .net tab
I'm using Visual Studio Express 2015, and targeting to .NET 4.5. None of the answers worked for me. Here's what I had to do (after many minutes of looking through Add References -> Assemblies -> Framework and playing around. The reference I added is "UIAutomationClient". (There isn't any System.Windows.Automation" assembly in my list. Note that I also see assemblies "UIAutomationProvider", "UIAutomationTypes", and "UIAutomationClientsideProviders", but I didn't try any of those.)
Anyway, once I got the reference to "UIAutomationClient" added, then the using System.Windows.Automation actually worked okay.
For .Net coreapp 3.1, my fix is adding UseWPF into PropertyGroup of csproj file.
<UseWPF>true</UseWPF>
In VS 2015, you need to reference the UIAutomationProvider dll to use this Provider namespace. Just add a reference to this dll in your references folder. It's available in the Framework Assemblies of .NET.