Skip to content

How to reference other projects with DllExport #156

@tetradice

Description

@tetradice

Hello.
Probably I think I'm overlooking the basics, but I couldn't solve it by looking at the Wiki or Issues, so please help.

I have registered two projects in one solution.

  1. Util - Class library without DLLExport.
  2. DllExportTest - Class library with DLLExport. It references the Util project.

In this state, if you build DLLExportTest and call the function, FileNotFoundException will occur before entering the process. The content of the message is that "Util, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" cannot be found.

What kind of preparation does DllExport have to do to reference the project?

DLLExportTest/Main.cs

using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace DllExportTest
{
    public class Dll
    {
        [DllExport]
        public static bool load(IntPtr dllDirPathPtr, int len)
        {
            var util = new Util.UtilClass();

            return true;
        }
    }
}

Util/UtilClass.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Util
{
    public class UtilClass
    {
    }
}

Config

WS000806

WS000807

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions