Add DLL reference to visual studio macros - c#

I need to create a lot of macros in visual studio the probelem is I do not know visual basic that good.
What I have been doing so far is:
Create the algorithm "Code" I plan to use on C# on a console
application. I complile it then decomplite it with reflector into
visual basic.
When I decompile the code I lose the comments plus sometimes I have to
refer back to the code and it becomes hard to manage.
I am tired of compiling and decompiling plus I have to make a few twick every now and then. I will like to create a service or library that I could reference somewhere through:
When I right click on reference and select add reference there is no way of selecting my own custom dll. Maybe there is a way of referencing the dll through code.
What I been trying to do is trying to register the dll so that my dll would appear in:
If I manage to register the dll it will be easier to supply my macros to other people...

Your answer might be here...
http://social.msdn.microsoft.com/Forums/is/vsx/thread/7b5d4c41-3a05-4a82-9a7d-aa6266fdbd25
....copy your assembly into
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies
(change the Visual Studio version number in the path as appropriate)
Related links:
C# for writing macros in Visual Studio?

Related

Referenced Nuget DLL Not Found Working Visual Studio

I added a Nuget library called Mpir.Net, which specializes in manipulating gigantic numbers much faster than the in-built BigInteger class does. When I added it in, Visual Studio 2017 was able to find the DLL, add it into my references, and provide suggestions based on the variables and functions defined in the DLL. Visual Studio was clearly able to find the DLL, unlike many questions on here from people with similar problems.
The problem is that when I run the program, it says xmpir64.dll not found, even though Visual Studio can reference things inside it in the code editor.
I've tried changing the target .NET version to no avail. What is the problem?
As a side note, I'm very new to C# and Visual Studio, so please keep that in mind when answering. Here is a link to a picture of my solution explorer.
Mpir.Net is a wrapper around an unmanaged library (GMP). When it says it's unable to find the DLL, it's because it's looking for the unmanaged one (xmpir64.dll) which is in your project folder (not the managed one in the references, which is the wrapper).
You probably just need to click on xmpir64.dll (and the x32 one too), look at its properties in the bottom right, and ensure copy to output directory is set to "copy always".
As a side note, Mpir.NET does not dispose of its unmanaged resources correctly, so don't be surprised if you have a big memory leak. I don't think I'd use it for commercial code.

Visual Studio: Writing hints visible in other projects

Using Visual Studio 2013 and .NET I've created set of widgets which I want to use in external projects. Each class and method is well documented with the XML-style comments. For example:
///<summary>...</summary>
When I use already commented code within the same solution, the appearing prompt suggesting how to finish the line contains my remarks. Nevertheless, when I tried to generate a DLL file with the code and use it in the external project the comments were not available anymore. How can I document code to make these hints visible in other projects using the compiled DLL?
If you want to use Code Documentation when referencing dll you have to generate XML documentation. XML documentation has to be in same folder that .dll is in.

How to Create a DLL file in Visual Studio C# 2010 Express edition?

I have already come across the Stack Overflow question "Is there a way to generate a DLL file from Visual Studio Express without explicitly creating a DLL project?", but it does not directly answer my query, so I'm raising it here.
The problem I am facing while trying to make the DLL is that I can't find any option under Build named build class file.
I have changed the project property to class file (shown below)
This is how it is:
And here is how my build option is getting displayed:
Also when I am using the command-line option the dll file is getting generated but it is not getting the properties I'm setting in the application.
I am new with Visual Studio so a litte bit confused about this part.
The "Build Solution" option in your second screenshot is the thing you need to click to produce your dll, alternatively you can right click on your project in the Solution Explorer and click "Build":
(If you only have one project in your solution then these two will both do exactly the same thing)
The output dll will normally be placed in the bin\Debug or bin\Release directory depending on whether you are in Release or Debug configuration, check the "Build" tab of the project properties for the exact path.
The reason why you aren't seeing a "Build class file" option is because this is what the "Build project" menu item does - it will produce a class library if the project output type is "Class Library", a windows executable if the project output type is "Windows Application" etc...
You're not trying to build a class file - you're trying to build a class library.
And you just build the solution - that will build each of the projects in your solution, including your LicenseCheckLibrary project is just a class library project.
It looks like you're basically there - look in the bin\Debug or bin\Release folders under LicenseCheckLibrary, and you'll find the DLL.
Why would you want to avoid building a DLL file in the first place? Are you developing an EXE file in order to test the logic and then conver it to DLL once it is working fine? If yes, why not create two projects: Windows Console and Class Library. Inside Class Library implement the licensing logic and use Windows COnsole to test the logic. When you say you are new with Visual Studio, what exactly do you mean? You never used it before or you are new to .NET Framework programming? .NET Framework has certain classes for developing licenses. Also, there were quetions here on stackoverflow regarding the licensing. Find some of them instead of reinventing the wheel.
Have a look at this article http://www.developer.com/net/net/article.php/3074001
Create a new class library project
Create classes and code
compile Project
Dll Created
Create a new project
Click on Add Reference
Navigate to the class library folder
Go into the debug folder or whatever and include
Remember you will prob have to include the namespace. in the new
project.

Problem creating COM assembly in C# 2005

I am kind of new to C#. I built a class library in order to create a DLL which I need to reference from a VB.Net application.
I followed all the steps detailed in this this article in order to generate the COM assembly based on my C# class library.
All the process ran smoothly (create the key, run gacutil.exe to add the assembly to the cache), but I still can't see the DLL from my main project in order to add it as a reference.
What am I doing wrong? Any help will be appreciated
There's some pretty bad advice in that article, the GAC is a deployment detail and has no relevance to the task of writing and using an assembly on your dev machine. The entire process also has nothing to do with COM at all.
Get ahead by opening your VB.NET solution in Visual Studio. Right-click the solution in the Solution Explorer window, Add, New Project. Pick "Class Library" from the C# node. Now right-click your VB.NET project, Add Reference, Project tab and select your C# project. Any of the public C# classes you write are now available in your VB.NET code.
You might not see the solution if it contains only one VB.NET project. Fix with Tools + Options, Project and Solutions, General, tick "Always show solution".

Is there a way to generate a DLL file from Visual Studio Express without explicitly creating a DLL project?

Is there a way to generate a DLL file from Visual Studio Express without explicitly creating a DLL project?
EDIT:
Maybe my thinking process has gone astray on me, but I am trying to setup NUnit, and thought is needed a dll to run it... Please correct me if I am wrong.
Yes, you can change the Project Properties|Application|Output Type to either Windows Application, Console Application or Class Library, thus by selecting Class Library you will output a DLL.
I struggle to think why you'd want to do this though?
How do you mean? What exactly are you after?
You can create an exe project and change the output type (project properties)... or you can use csc /target:library at the command line...

Categories