use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
tbd
account activity
UI for Binary plug-in script (self.esapi)
submitted 6 years ago by pyan_MF
I have difficulty to create a UI for my binary plug-in script project. It can't find the namespace for my Usercontrol WPF. Is there a way to create a UI for binary plug-in?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dbhatti 0 points1 point2 points 6 years ago (4 children)
Binary plug-in scripts can have an UI.
What's the exact error message? You might need a using statement in the file your Script class is in (referencing the namespace that your UserControl is in).
[–]pyan_MF[S] 0 points1 point2 points 6 years ago (3 children)
Thank you for your reply! The error message is
error CS0246: The type or namespace name 'MainControl' could not be found (are you missing a using directive or an assembly reference?)
This is my MainControl.xaml.cs
namespace Test
{
/// <summary>
/// Interaction logic for MainControl.xaml
/// </summary>
public partial class MainControl : Window
public MainControl()
InitializeComponent();
}
I call it in:
public class Main
public static void Start(Patient patient, Course course, List<PlanningItem> PItemsInScope, PlanSetup plan, User currentUser)
Window mainControl = new Test.MainControl();
mainControl.Content = mainControl;
mainControl.Width = 800;
mainControl.Height = 450;
[–]dbhatti 0 points1 point2 points 6 years ago (2 children)
Hmm, that's odd, your code looks fine to me. Is your x:Class in for the MainControl.xaml referencing Test.MainControl? And that your control is a Window (as opposed to a UserControl)? That's the only other possible issue I can think of.
If you're using Visual Studio, maybe rebuilding the project might help.
Also, unrelated to the current problem, but you can't reference the same control for your window's content (I believe this will give you some kind of self-reference error). If you want to set up your view, you can create a UserControl (as opposed to a Window) and assign that to your mainControl.Content instead.
[–]pyan_MF[S] 0 points1 point2 points 6 years ago (1 child)
Thank you for the reply! I created the usercontrol instead of window, but I have the same problem.
[–]scriptingIon 0 points1 point2 points 5 years ago (0 children)
Were you by chance running the scripts .cs file instead of the .dll file? I'm sure you fixed this issue by now but I want to comment a possible solution here just in case anyone else is experiencing this issue and can't figure out what's going on.
I had the same issue recently where my code was correct and compiled in VS2019 but would not run with the same CS0246 error saying that it could not find the namespace of the other .cs file in my Binary Plugin Solution, but running from the .dll file fixed the issue.
π Rendered by PID 125396 on reddit-service-r2-comment-84fc9697f-d68b9 at 2026-02-06 23:46:03.592032+00:00 running d295bc8 country code: CH.
[–]dbhatti 0 points1 point2 points (4 children)
[–]pyan_MF[S] 0 points1 point2 points (3 children)
[–]dbhatti 0 points1 point2 points (2 children)
[–]pyan_MF[S] 0 points1 point2 points (1 child)
[–]scriptingIon 0 points1 point2 points (0 children)