Visual C# to Visual C++ [duplicate] - c#

This question already has answers here:
How to use c# Dll in vc++?
(3 answers)
Closed 9 years ago.
I need to use dlls, headers and functions from a Visual C# project in a Visual C++ project.
I tried to add the dlls via "Add References" but I keep getting this error...
Caching metadata information for e:\linha_3_os179\indutron_opc\treiberdlls\elabo.devices.g_series.deviceplugin.dll
Any suggetions?
Thanks!

I would try to expose the c# code as COM objects and then use COM from c to call them

Related

How to install Windows.Security.Credentials; C# .NET VS 2017 [duplicate]

This question already has answers here:
How to access the stored credentials (PasswordVault?) on Win7 and Win8?
(3 answers)
Closed 5 years ago.
how do I install Windows.Security.Credentials into VS 2017? I've looked everywhere and i can't find a thing. I cant add it through 'add reference'.
Thanks for any help.
Windows.Security.Credentials class avilible only in WinRT based projects type. For example in WindowsRuntimeComponent. You can't access to it from WinForms or Console project.

How to edit C# code in a .net DLL [duplicate]

This question already has answers here:
Edit .NET assembly and recompile
(3 answers)
Closed 7 years ago.
I have used many decompilers but have too little experience to understand where it is that I can edit the c# code of specific objects within the DLL. Is it possible to simply edit the C# code and save the changes? If so how could I go about doing this?
TL:DR
How do I edit C# code inside a DLL that I do not have the source code for?
You can edit & patch .NET DLL/EXE with https://github.com/0xd4d/dnSpy
Worked perfectly well for me.

Add a file and import it to projects in same solution? [duplicate]

This question already has answers here:
How do you share code between projects/solutions in Visual Studio?
(17 answers)
Closed 8 years ago.
I want to have a file with some enum's and use them in several projects in the same solution.
How could I use the same enums throught projects in the same solution instead of having to copy them into every .cs file?
Im from xcode and obj-c and not very used to Visual Studio c# :(
If you have multiple projects that need to share source code you would create a new project as a class library type. Add the code to that project and then add it as a reference to the other projects that need it. Visual Studio will then handle building and sharing of the code for you.
To use the code in those projects you will have to define the using of the shared project in the C# files that need it.
If you need more detailed instructions. Just let me know.

How to add f# file to c# class library [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is it possible to mix .cs (C#) and .fs (F#) files in a single Visual Studio Windows Console Project? (.NET)
I have a c# class library project. What is the best way to get f# files working in the same project?
You can't. You'd need to create these as separate projects. It might however be possible to merge to create a single assembly on build using ILMerge.

Interoperability of C# and C++ (.net) [duplicate]

This question already has an answer here:
Closed 12 years ago.
Possible Duplicate:
Call C# dll function from Visual C++
I have a set of C# classes. Can I import these classes in a C++ project like libraries and use them in this new project?
Yes. You have to reference the dll.
You said C++/CLI, correct?

Categories