Adding reference to C# Project - c#

I'm having an issue adding a reference to my C# project. I need to add a dll called PhpNetCore. I have located this DLL with Windows Explorer in Assembly\GAC_MSIL\PhpNetCore. However, when I browse with the Visual Studio explorer to add a reference to the DLL it doesn't show up. They are simply not visible. What gives?
Using Windows Explorer, I copied the PhpNetCore folder to my desktop. I was then able to add a reference without any issues.
Thanks in advance for any help.
-Geoff

That's "as designed" for Visual Studio. The GAC is for publishers to share assemblies with multiple applications. Publishers can share assemblies with developers in Common Files\Reference Assemblies.
The ideal method of adding a reference to your project is to use the NuGet package manager.
If neither of those are available, copying is okay, too.

I am not sure about that library but I found a way to use it installation free if this is of any help.
Installation-Free Phalanger

Related

Visual Studio creates bin folder on opening web application solution?

Visual Studio is creating a \bin folder and copying various assemblies into it when I open a web application solution, even before I compile
What is triggering this action?
And how do I control it?
Reason I'm questioning the process, is the assemblies are not the expected ones
This is where Visual Studio puts all the dlls for runtime for your project. Library dependencies that the project needs. All the dlls that Visual Studio needs for a web project are kept here as well as other packages from Nuget that you might add, and your own. If you look in the References section in the Web Project, you will see many of the dlls that appear in the bin directory.
If there are some assemblies there that you do not want. You can try removing the reference from the Reference folder. Right click on the library in the Reference folder and select remove.
Be careful with removing references though, because your project may need it to function.

Add a Reference to 3rd party DLL in Visual studio 2010- Sandbox Solution

I need to add the Repatcha.dll as a reference to my sharepoint sandbox solution. How can I refer to this DLL using Visual studio 2010?
It should be packaged and needed to upload to the online site as a sandbox solution.Please provide me the steps to add the reference to my project.
Please help.
Thanks in Advance!
You cand add the assemblie reference to VS like others projects using Add Reference or Nuget.
The second step is use the package configuration in order to deploy the reqeuired assembly to the target machine.
Check the "Advanced" package configuration from your webpart solution. There is some configuration relative to others assemblies that you can register into GAC or WebApplication.

Error Message when Referencing .dll Files

I would like the use DirectInput in my XNA game however I'm having an issue when it comes to referencing the .dll file. I'm using Microsoft Visual Studio C# Express Edition. This is exactly what I do:
right click "References"
chose "add reference"
navigate to the .dll file and hit OK
I then receive the following error:
As stated above I would like to reference the Microsoft.DirectX.DirectInput namespace but I don't know which .dll file that it's in so I just picked the "d3dref9.dll". Every .dll file under that directory doesn't work though so any one I pick gives me the same error. Now I've been able to accomplish this with other .dll files but for some reason the DirectX ones wont work. I know it's possible beacuse this guy did it just look at the second line in his code.
I have the DirectX SDK installed why can't I reference any of the .dll files and how can I make it so I can?
Thanks!
The problem here is that you are adding a reference to a native DLL while managed projects only support managed DLLS. I believe the DLL you are looking for is Microsoft.DirectX.dll. That has the managed wrappers for DirectX
I think you are trying to reference .dlls that are not .NET assemblies, and/or not COM libraries.
This link might help with locating the propper .dlls:
(copy/paste from linked post:)
What you need to do is add the correct DLLs as references to your
project. Since they are not in the list, you'll have to add them
manually. I am assuming you are using the October SDK?
What you'll need to do is:
Right-click on References folder, and select "Add Reference..."
On the .NET tab, select the "Browse" button.
Navigate to where you installed the SDK. (On my machine it is C:\Program Files\Microsoft DirectX 9.0 SDK)
The files you are looking for should be in ".\Developer Runtime\x86\DirectX for Managed Code"
Select the DLLs that you want (in this case Microsoft.DirectX.dll, Microsoft.DirectX.DirectInput.dll)

what should I do about missing namespaces?

While using Visual Studio C# Express 2010, I've noticed a small problem; namespaces such as System.Windows and System.Drawing are missing, so where could I find them, or can I download them online?
P.S: I've opened the System reference and really got worried as I didn't find those references.
The two assemblies you mentioned are available only for Windows applications. If you are creating a console application such assemblies are not even shown in the Add References.
Under your references folder, in the Solution Explorer click Add Reference
Click the .NET tab.
Find your reference.
When you open up your Add Reference dialog you should have a .NET tab. In there you should find the references you require.
System.Windows may not be there but its members should be.

How can I include files in a C# deployment?

I have a DLL I need to deploy with my C# application. It's not currently included in the installation package when I hit "Publish" so how do I include it?
Would the process be any different if I had app.config and other files I wanted to deploy with my application?
If it's referenced it should be included automatically. I've deployed a couple of apps that require a 3rd party dll and they've published OK.
Is the dll referenced correctly in your project? That's the only thing I can think of at the moment that might be the problem, but if it wasn't your code wouldn't compile and/or link anyway.
To get the xls file to deploy all you need to do is add the file to the solution and then set the "Copy to Output Directory" property on the file.
I take it you are using Visual Studio?
If your using Visual Studio 2008 (I have no experience with Visual Studio 2005) under the Publish tab in your project properties click on the Application Files button. This will bring up a list of all dependencies assembalies required by your project. If you find that required dll is not being published by the Visual Studio publisher tool by default you can go into here and set the Publish Status of the offending dll to Include.
Sometimes in my more complicated projects, depending on the type of dependency, I have to go into this menu and force certain dll's to be included opposed to the default Prerequsite setting.
...but this is all under the assumption you have the assembly properly referenced in the required projects and everything is compiling fine.
Can't you add the dll as a resource to your installer project?

Categories