c# dll what I am doing wrong?

I’ve tried to get this sorted here:
c# building dll, why do I get an error only in dll build

But its turning into a bit of a huge mess with no clear way forward. I’ve added an enum to a dll and I want to get the num names as a string array, but this causes the application and debugger to crash.

In my dll I’ve create a wrapper class:

namespace myNamespace {
    public enum myEnum {
      on,
      off
    };
    public class ENUM {
        static public string[] GetMyEnumNames() {
            return typeof(myEnum).GetNestedType("myEnum").GetEnumNames();
        }
    }
}

From my c# application, at the top of a cs file I have:

using myNamespace;

Somewhere in the code:

string[] names = myNamespace.ENUM.GetMyEnumNames();

I launch the application in the IDE which is MSVC 2022 Professional, with the above in place it crashes before it hits the line, the function that calls it is the one that crashes, I have no idea why, the error message isn’t very helpful:

System.IO.FileNotFoundException
  HResult=0x80070002
  Message=Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
  Source=DataLoggerCS
  StackTrace:
   at DataLogger.FrmMain.InitGUI() in C:LocalDevVisualStudioProjectFrmMain.cs:line 408
   at DataLogger.FrmMain.FrmMain_Shown(Object sender, EventArgs e) in C:LocalDevVisualStudioProjectFrmMain.cs:line 752
   at System.Windows.Forms.Form.OnShown(EventArgs e) in System.Windows.FormsForm.cs:line 4840
   at System.Windows.Forms.Form.CallShownEvent() in System.Windows.FormsForm.cs:line 4156
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) in System.Windows.FormsControl.cs:line 10918
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) in System.Windows.FormsControl.cs:line 10905
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) in System.ThreadingExecutionContext.cs:line 516
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) in System.ThreadingExecutionContext.cs:line 487
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in System.ThreadingExecutionContext.cs:line 480
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) in System.Windows.FormsControl.cs:line 10888
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks() in System.Windows.FormsControl.cs:line 10965
   at System.Windows.Forms.Control.WndProc(Message& m) in System.Windows.FormsControl.cs:line 16167
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m) in System.Windows.FormsScrollableControl.cs:line 1480
   at System.Windows.Forms.Form.WndProc(Message& m) in System.Windows.FormsForm.cs:line 6763
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) in System.Windows.FormsControl.cs:line 136
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) in System.Windows.FormsControl.cs:line 164
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) in System.Windows.FormsNativeWindow.cs:line 761
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) in System.Windows.FormsApplication.cs:line 305
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) in System.Windows.FormsApplication.cs:line 1236
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) in System.Windows.FormsApplication.cs:line 1152
   at System.Windows.Forms.Application.Run(Form mainForm) in System.Windows.FormsApplication.cs:line 3232
   at DataLogger.Program.Main() in C:LocalDevVisualStudioProjectProgram.cs:line 25

Can anyone help me?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật