_read_only_
_read_only_
CC#
Created by _read_only_ on 4/27/2024 in #help
MEF No exports were found that match the constraint
chatgpt for the win lol, idk how this happened but its working now
However, I noticed that the Plugin class is using the [Export] attribute from the System.Composition namespace, while the App class is using the [Import] attribute from the System.ComponentModel.Composition namespace. These are two different versions of MEF and they're not compatible with each other.
However, I noticed that the Plugin class is using the [Export] attribute from the System.Composition namespace, while the App class is using the [Import] attribute from the System.ComponentModel.Composition namespace. These are two different versions of MEF and they're not compatible with each other.
12 replies
CC#
Created by _read_only_ on 4/27/2024 in #help
MEF No exports were found that match the constraint
hi @Lex Li you recommended me MEF yesterday, do you have any idea whats wrong here
12 replies
CC#
Created by _read_only_ on 4/27/2024 in #help
MEF No exports were found that match the constraint
both reference .Shared
12 replies
CC#
Created by _read_only_ on 4/27/2024 in #help
MEF No exports were found that match the constraint
this is what I have currently
namespace Wpf.Shared
{
public interface IPlugin
{
void Process();
string Name { get; }
string Description { get; }
}
}
namespace Wpf.Shared
{
public interface IPlugin
{
void Process();
string Name { get; }
string Description { get; }
}
}
namespace Wpf.Private;

[Export(typeof(IPlugin))]
public class Plugin : IPlugin
{
public string Name => "Plugin";
public string Description => "Plugin";

public void Process()
{
Console.WriteLine("Plugin");
}
}
namespace Wpf.Private;

[Export(typeof(IPlugin))]
public class Plugin : IPlugin
{
public string Name => "Plugin";
public string Description => "Plugin";

public void Process()
{
Console.WriteLine("Plugin");
}
}
public partial class App : Application
{
[Import(typeof(IPlugin))]
public IPlugin plugin;

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

string plugins = System.IO.Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"WPFAPP", "plugins");

if (!Directory.Exists(plugins))
{
Directory.CreateDirectory(plugins);
}

var catalog = new DirectoryCatalog(plugins);

try
{
var container = new CompositionContainer(catalog);
container.ComposeParts(this);
}
catch (Exception ex)
{
Console.WriteLine($"ex: {ex}");
}
}
}
public partial class App : Application
{
[Import(typeof(IPlugin))]
public IPlugin plugin;

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

string plugins = System.IO.Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"WPFAPP", "plugins");

if (!Directory.Exists(plugins))
{
Directory.CreateDirectory(plugins);
}

var catalog = new DirectoryCatalog(plugins);

try
{
var container = new CompositionContainer(catalog);
container.ComposeParts(this);
}
catch (Exception ex)
{
Console.WriteLine($"ex: {ex}");
}
}
}
12 replies
CC#
Created by _read_only_ on 4/27/2024 in #help
MEF No exports were found that match the constraint
just as a quick test, also tried with creating another shared dll
12 replies
CC#
Created by _read_only_ on 4/27/2024 in #help
MEF No exports were found that match the constraint
looks like its the same when I leave IPlugin interface in wpf app, and add project reference to plugin to use same interface
12 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
at least they won't be able to copy paste
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
as long as I can make others struggle to read decompiled exe, I'm fine with it
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
then how enforce legal way of doing stuff
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
I know everything client can be reversed. But I'm not experienced in it at all
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
how would you check if someone is reusing your code if their app would be closed-source and heavily obfuscated / virtualized or whatever
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
Maaaybe it could, but that would be a lot of work that I would like to avoid 😂 Looking for possibilities within wpf app. If there is nothing viable maybe I'll consider converting to web service
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
great, I'll check MEF/Mono.addins
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
Here comes question 1 - how can I reference dll that will be available only in shipped version? How can I prevent compiler errors when there will be some part of code missing?
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
its related to 3d rendering with directx, I would like to have additional paid features for it, like slice geometry or so
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
How would that work for WPF desktop app? I need to display interface and such
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
just looking for a way to be unique with unique features, even if they are not open sourced
34 replies
CC#
Created by _read_only_ on 4/26/2024 in #help
"Protected" dll reference
99% of code is still open sourced, just some "early access" paid features will be hidden for some time, and eventually released. It is what it is with competitiors, when I will just release it open sourced they will copy paste in one week 😛
34 replies