Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9015895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:51:50+00:00 2026-06-16T03:51:50+00:00

For our current project we are using DBus (1.6.n). It is largely accessed from

  • 0

For our current project we are using DBus (1.6.n).
It is largely accessed from C++ in shared memory mode, and this works really well.

I am now trying to access the same DBus from a C# program.

In order to try things out first, I downloaded the latest version of dbus-sharp I could find, and started the daemon included in the download to see if I could connect to it from my test C# app.

Whenever I make a connection, the daemon console shows that I am communicating with it, but as soon as I try to access any methods on the connection I get the error;

‘Access is denied: DBus.BusObject’

Here is the code I have tried;

        DBus.Bus dBus = null;
        try
        {
            //input address comes from the UI and ends up as "tcp:host=localhost,port=12345";
            //dBus = new Bus(InputAddress.Text + inputAddressExtension.Text);
            //string s = dBus.GetId();
            //dBus.Close();

            //DBus.Bus bus = DBus.Bus.System;
            //DBus.Bus bus = Bus.Open(InputAddress.Text + inputAddressExtension.Text);
            //DBus.Bus bus = DBus.Bus.Session;
            //DBus.Bus bus = DBus.Bus.Starter;

            var conn = Connection.Open(InputAddress.Text + inputAddressExtension.Text);
            var bus = conn.GetObject<Introspectable>(@"org.freedesktop.DBus.Introspectable", new ObjectPath("/org/freedesktop/DBus/Introspectable"));

            bus.Introspect();

        }
        finally
        {
            if(dBus != null)
                dBus.Close();
        }

The commented code produces the same error eventually too.

I have stepped through with the debugger and it always gets to the following code in the TypeImplementer.cs;

public Type GetImplementation (Type declType)
{
Type retT;

        lock (getImplLock)
            if (map.TryGetValue (declType, out retT))
                return retT;

        string proxyName = declType.FullName + "Proxy";

        Type parentType;

        if (declType.IsInterface)
            parentType = typeof (BusObject);
        else
            parentType = declType;

        TypeBuilder typeB = modB.DefineType (proxyName, TypeAttributes.Class | TypeAttributes.Public, parentType);

        if (declType.IsInterface)
            Implement (typeB, declType);

        foreach (Type iface in declType.GetInterfaces ())
            Implement (typeB, iface);

        retT = typeB.CreateType (); <======== Fails here ==========

        lock (getImplLock)
            map[declType] = retT;

        return retT;
    }

I have not found any useful examples or documentation about accessing DBus from C#, and there seem to be few recent entries about this anywhere, so maybe no-one else is trying this.

I am running the daemon in the same folder as the test program.
As I am running on windows, the daemon is listening on the tcp setting;

string addr = “tcp:host=localhost,port=12345”;

Since this is the example included with the download, I thought it would be really simple to get it going, but alas no luck yet.

Has anyone else been here and know the next piece of the puzzle?

Any ideas would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:51:51+00:00Added an answer on June 16, 2026 at 3:51 am

    Having received no comment or response, I will answer the question with the information I have found since asking it.

    There appears to be no useful C# interface to DBus. (By useful, I mean one that works!)
    The only information or examples I could find are not up to date and no effort appears to be being expended on providing a working interface.

    I have decided to interface with DBus by using a C++ implementation written as a Windows service, and my C# program will send messages to DBus via the service. This seems to work ok, so satisfies the business need.

    I am disappointed not to be able to get the C# to DBus working, but there are lots of service bus implementations that work on Windows, so in future I will look at implementing those instead of DBus.

    If anyone does come up with a workable, documented solution to accessing DBus from C# on Windows, I would still be interested to see it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in our current project we are using ADO.NET Entity Framework as data layer for
I'm using Camel 2.9.x for integration purposes in our current project. One of the
So while we're using foreign keys in our current project, I've heard the argument
We are using log4j+commons-logging in our current projects. Now we are mirgrating from log4j
Our flex project, which works fine in its current environment with coldfusion 7 single
On our current WPF project, we've been performing dependency injection using the Ninject IOC
For the current project we're using JSR-303 annotations to validate our interface parameters. I
Our current project is written in ASP.NET MVC 1 using mvc-turbines (and unity) for
Our current project does not use Hibernate (for various reasons) and we are using
Our current iOS project requires localization of video assets. We are currently handling this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.