Unable to Add C++ Dll in C# project

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

I am trying to add a dll (created as a VC++ project) in VS2005 to a C#
project for a Smart Device.
Each time I try to add reference, an error message is thrown up
stating "Unable to add Dll".

Following are the steps I followed:

1. Add New Project -> VC++ -> Smart Device -> Win32 Smart Device
Project -> Dll
2. Build project (Test.dll). (empty dll project for testing)
3. In my C# project, Add reference -> Test.dll

At this point it throws up an error stating "A reference to Test.dll
could not be added".

I tried registering the Dll with "regasm" but even that threw an error
stating "Test.dll is not a valid .Net assembly"

Is there something wrong with the procedure followed by me or is it
some other issue (like an installation issue)?

Thanks in advance,
Treadstone

.



Relevant Pages

  • VB FAQs (Interview Questions) lot lot
    ... Consider two objects, A and B. A holds a reference to B, ... Why do so many example programs not use the DLL name ... Private Declare Function SendMessage Lib "user32" ... Private Const BUFFER_LENGTH As Long = 255 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sharing Code
    ... What I found would happen is that when the device dll was built visual ... In the desktop project when you add a reference to the dll, ... > projects, one smart device and one desktop, but they're in the same ... > The 2 form projects have references to this class library projects. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Namespaces - broad question
    ... Reference the Class Library in your Page, ... > aspx pages that I know I want utilize a specific function within, ... > have the same codebehind page), how can I reference this function. ... >> A .Net assembly is a compiled DLL. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Namespace Question
    ... >>i saw that when i changed it to true my dll was copied to the bin folder ... >>the reference by looking in the following locations, ... Look for assemblies in directories specified with the Reference Path ... >> tried to use the GAC but the process to convert dll to be strong name ...
    (microsoft.public.dotnet.languages.vb)
  • Re: calling from one workbook the classes and functions in another
    ... having discovered the vb trick recently I'm suddenly a big fan ... > reference to the instantiated class. ... you can't instantiate the class. ... >> Copy your cls into a VB Project for an activex dll. ...
    (microsoft.public.excel.programming)