troubleshooting Question

.Net Reflection

Avatar of Arikkan
ArikkanFlag for United States of America asked on
.NET Programming* Reflection
1 Comment1 Solution22 ViewsLast Modified:
I have two different Solutions and all of them using VB.Net .NetFramework 4.7.1:
Solution1 (Running as Windows Service)
                Project with Name=Common, Output=dll, OutputFile=Common.dll, Version=1.1.2.31
                                NameSpace=Name1.NAMe2.Name3
                                                Class with Name=GlobalConstants
                                                                Enum defined in GlobalConstants=
{Public Enum CustomerStatus
                Active=1
                Inactive=2
}
                                                Class with Name=CommonFunctionsDA
                                                                MethodName=Method1 in class CommonFunctionDA
                Project with Name=CVRTimer, Output=exe, OutputFile=CVRTimer.exe, Version=1.0.0.0, References=”Common.dll v1.1.2.31”
                                NameSpace=Name1.Name4.Name5
                                                Class with Name=MOCVRTimer
                                                                                Method=
Public Sub SomeMethod()
                                                Load Assembly Reports.dll from Solution2 using Reflection
                                                Create Object of Type=CustomersReport
                                                Created Object of MethodInfo=Method8
                                                Invoke Method8 of CustomersReport
End Sub
 
Solution2(.Net Desktop Application)
                Project with Name=Common, Output=dll, OutputFile=Common.dll, Version=2.0.0.0
                                NameSpace=Name1.Name2.Name3
                                                Class with Name=GlobalConstants
                                                                Enum defined in GlobalConstants=
{Public Enum VoterStatus
                Active=1
                Inactive=2
}
                                                Class with Name=CommonFunctionsDA
                                                                MethodName=Method1 in class CommonFunctionDA
                Project with Name=Reports, Output=dll, OutputFile=Reports.dll, Version=1.0.0.0, References=”Common.dll v2.0.0.0”
                                Namespace=Name1.Name6.Name7
                                                Class with Name=CustomersReport
                                                                MethodName=Method8 in class CustomersReport which is calling CommonFunctionsDA.Method1
                                                                                Public Function Method8() As Boolean
                                                                                                Dim obj As New CommonFunctionsDA
                                                                                                Do some Work
                                                                                                Obj.Method1()
                                                                                                If SomeVariable=GlobalConstants.CustomerStatus.Active Then
                                                                                                                Some more work
                                                                                                End If
                                                                                                Return True
                                                                                End Function
                Project with Name=CVR, Output=exe, OutputFile=CVR.exe, Version=1.0.0.0, References=”Common.dll v2.0.0.0, Reports.dll”
                                NameSpace=Name1.Name8.Name9
                                                Class with Name=CVR
 
 
 
When I use Reflection to call a method (ObjectOfReports.Method2) of Reports.dll(in Solution2) through MOCVRTimer.exe (in Solution1) which is using a method (ObjectOfCommonVersionTwo.Method1) of Common.dll (v2.0.0.0) then also at runtime it will use the ObjectOfCommonVersion1.Method1 from Common.dll (v1.1.2.31)
How I can make sure that when I am call a method (ObjectOfReports.Method2) of Reports.dll(in Solution2) through MOCVRTimer.exe (in Solution1) then also it should use ObjectOfCommonVersionTwoDotZero.Method1 instead of ObjectOfCommonVersionOneDotOne.Method1 ?
 
ASKER CERTIFIED SOLUTION
Kyle Abrahams
Director of Information Technology

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros