473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to make C# dll accessible as a reference???

37
Hi.

I have searched this topic for some time now and have a number of marked resources but nothing seems to work.

I have a project that I've created that has several dll files I've created in C# that I use as a reference within my project. I know I can create a deploy package and include those dll files to be copied to the app directory and the program will run as intended. But preferably I don't want to have the dll files exploited this way.

So I have been trying to find ways to include the files in my project by some other method than to browse to dll and manually bring it in this way. I would prefer to include it as a possibly a COM object and reference it that way. Then I could simply have it registered on the users system during the setup and have the program make calls to the public methods within the dll assembly.

So far I have tried REGASM with the /codebase and also /tbl to create a type library but I still can't see my dll objects in the COM section when I try to reference them.

Can anybody tell me what I am doing wrong?????

I would be extremely grateful for any assistance.

thx
Dec 13 '07 #1
3 2459
Plater
7,872 Expert 4TB
Have you set COM visible to true in your DLLs?
The assembly file in your DLL should have that option, along with the GUID
Dec 13 '07 #2
mivey4
37
Have you set COM visible to true in your DLLs?
The assembly file in your DLL should have that option, along with the GUID
Hi Plater,

yes, in fact I have done this among other things that I've read in documentations including setting the "Register for COM interop" on
and placing the following line of code above the class.

[ComVisible(true),ClassInterface(ClassInterfaceType .AutoDual),Guid("AC38E751-EWE0-4791-963C-A0C16370FD49")]

Here's a snippet of my AssemblyInfo.cs file
===============================================

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LogParser")]
[assembly: AssemblyDescription("Provides methods for access and manipulation of filesystem files")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("LogParser")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("28687fe6-5073-4bab-b6fa-275d4e71f1e7")]

===============================================

thx
Dec 13 '07 #3
mivey4
37
Hi Plater,

yes, in fact I have done this among other things that I've read in documentations including setting the "Register for COM interop" on
and placing the following line of code above the class.

[ComVisible(true),ClassInterface(ClassInterfaceType .AutoDual),Guid("AC38E751-EWE0-4791-963C-A0C16370FD49")]

Here's a snippet of my AssemblyInfo.cs file
===============================================

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LogParser")]
[assembly: AssemblyDescription("Provides methods for access and manipulation of filesystem files")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("LogParser")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("28687fe6-5073-4bab-b6fa-275d4e71f1e7")]

===============================================

thx
Does anyone know where I can find any additional documentation that may be able to help me figure my problem out or is familiar with this process and can provide some clues to set me in the right direction?
Dec 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: BKM | last post by:
I've been using the following 2 ways to make sure my WebBrowser is finished loading a page before continuing with the next code. do:doevents:loop while WebBrowser.Busy do:doevents:loop until...
7
by: tedqn | last post by:
I keep getting the error of not shared member or something. Basically within a class, I have a constructor that takes in an sql connection string and init a connection object to be accessible by...
6
by: Murphy | last post by:
I've read through the google posts on this topic and am still unclear of the solution. Simply I have a user control that contains form controls and I would like to reference the values in the...
3
by: MJ | last post by:
i have form1 and form2, form1 has a picturebox which i wish to make it accessible to other forms after form2 perform some drawing, it need to call form1.picbox.invalidate() to refresh the picbox,...
1
by: steve | last post by:
I am trying to create an XSLT Transform but keep getting the same problem. Overload resolution failed because no accessible 'Transform' can be called with these arguments. I create a reference...
2
by: Steven T. Hatton | last post by:
Can somebody explain why making T a friend of either B or C will permit the code to compile? class A{ protected: A(){} }; class T; class B: protected A {protected: B(){}/*friend class T;*/};...
3
by: keith.thornhill | last post by:
hey all, got a problem here using Visual basic .net 2005 i have two pairs of base/derived classes. lets call them Base/Derived and BaseStruct/DerivedStruct. i want to be able to instantiate a...
4
by: adodotnet20 | last post by:
I'm developing a Windows application and I'm having some problems in making variable accessible to the whole application. I use VS.NET 2005 and I create a database connection object in the method ...
7
by: André | last post by:
Hi, I need several cookies depending of an variable (x), so i defined a HttpCookie() as an array. My problems: 1)I get the error: Object reference not set to an instance of an object. 2)My...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.