Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Example
- {
- public int Id { get; set; }
- public string Property1{ get; set; }
- public string Property2{ get; set; }
- }
- public List<Example> TestingCallFromSeparateConsoleApp()
- {
- List<Example> exampleList = new List<Example>();
- exampleList.Add(new Example
- {
- Id = 1,
- Property1 = "First",
- Property2 = "First",
- });
- exampleList.Add(new Example
- {
- Id = 2,
- Property1 = "Second",
- Property2 = "Second",
- });
- return exampleList;
- }
- asm = Assembly.LoadFrom(assemblyFile);
- var smsAppInstance = asm.CreateInstance("EngineeringAssistantMVC.Controllers.TestController", false, BindingFlags.CreateInstance, null, null, null, null);
- var ExampleClass = asm.GetType("EngineeringAssistant.Controllers.Example", true);
- var ec = ExampleClass.GetType();
- ExampleClass newExampleClass = new ExampleClass();
- var result = smsAppInstance.GetType().GetMethod("TestingCallFromSeparateConsoleApp").Invoke(smsAppInstance, argumentsTopass);
- Right click project -> Add -> Reference
Add Comment
Please, Sign In to add comment