Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
Questionip address Pin
AlexPizzano24-Jul-08 2:16
AlexPizzano24-Jul-08 2:16 
AnswerRe: ip address Pin
teejayem24-Jul-08 2:27
teejayem24-Jul-08 2:27 
AnswerRe: ip address Pin
stancrm24-Jul-08 2:52
stancrm24-Jul-08 2:52 
AnswerRe: ip address Pin
Simon P Stevens24-Jul-08 3:00
Simon P Stevens24-Jul-08 3:00 
AnswerRe: ip address Pin
nelsonpaixao24-Jul-08 13:25
nelsonpaixao24-Jul-08 13:25 
GeneralRe: ip address Pin
Abdul Sami X24-Jul-08 19:57
Abdul Sami X24-Jul-08 19:57 
AnswerRe: ip address Pin
Mogaambo25-Jul-08 1:34
Mogaambo25-Jul-08 1:34 
QuestionReflection in a Windows Service & WCF Pin
Bernard Laplace24-Jul-08 1:58
Bernard Laplace24-Jul-08 1:58 
Hi,
I am trying to run the following code in a dynamically loaded WCF service hosted in a Windows Service.
It seems I can't load types because of the following exception:

Could not load file or assembly 'APLUGINASSEMBLY, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ddd7975916a1e051' or one of its dependencies. The system cannot find the file specified.

Here is the list of the referenced assemblies:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Viveo.Data, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ddd7975916a1e051
NavigationProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullSystem.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Please note that the very same code works fine when I run the WCF Service from Visual Studio. D'Oh! | :doh:

Thanks.

protected static void AnalysePlugins(Assembly[] Assemblies)
        {
            foreach (Assembly anAssembly in Assemblies)
            {
                try
                {
                    foreach (Type aType in anAssembly.GetExportedTypes())
                    {
                        try
                        {
                            if (aType.GetInterface("ANINTERFACE") != null)
                            {
                                //Retrieves the name of each navigation
                                string theNavigationName = (string)aType.InvokeMember("Name", BindingFlags.GetProperty, null, aType.GetConstructor(new Type[]{}).Invoke(new object[]{}), null);
                                //Fills the data structures that keep reference of the navigation/type/assembly
                                NavigationRepository[theNavigationName] = aType;
                                PluginRepository[aType] = anAssembly;
                            }
                        }
                        catch(Exception ex)
                        {
                            Trace.WriteLine(aType + " could not have its name queried");
                        }
                    }
                }
                catch (Exception ex)
                {

                    System.Diagnostics.EventLog.WriteEntry("BusinessServer", ex.Message);
                    System.Diagnostics.EventLog.WriteEntry("BusinessServer", string.Concat(anAssembly.GetReferencedAssemblies()));
                }
            }
        }

AnswerRe: Reflection in a Windows Service & WCF Pin
Bernard Laplace24-Jul-08 5:28
Bernard Laplace24-Jul-08 5:28 
Questionimage manipulation Pin
Zafar Sultan24-Jul-08 1:28
Zafar Sultan24-Jul-08 1:28 
AnswerRe: image manipulation Pin
CPallini24-Jul-08 1:49
mveCPallini24-Jul-08 1:49 
QuestionThread.Sleep(1) taking much longer on Vista than on XP. Pin
Yeates24-Jul-08 0:43
Yeates24-Jul-08 0:43 
AnswerRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
Anthony Mushrow24-Jul-08 1:14
professionalAnthony Mushrow24-Jul-08 1:14 
GeneralRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
Luc Pattyn24-Jul-08 2:31
sitebuilderLuc Pattyn24-Jul-08 2:31 
GeneralRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
Anthony Mushrow24-Jul-08 4:04
professionalAnthony Mushrow24-Jul-08 4:04 
GeneralRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
Yeates24-Jul-08 4:03
Yeates24-Jul-08 4:03 
GeneralRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
Dan Neely24-Jul-08 5:50
Dan Neely24-Jul-08 5:50 
GeneralRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
JoeRip24-Jul-08 12:21
JoeRip24-Jul-08 12:21 
AnswerRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
Dan Neely24-Jul-08 2:22
Dan Neely24-Jul-08 2:22 
AnswerRe: Thread.Sleep(1) taking much longer on Vista than on XP. Pin
Luc Pattyn24-Jul-08 2:28
sitebuilderLuc Pattyn24-Jul-08 2:28 
Questionpopulating collection of collection Pin
arkiboys24-Jul-08 0:37
arkiboys24-Jul-08 0:37 
AnswerRe: populating collection of collection Pin
Wendelius24-Jul-08 7:08
mentorWendelius24-Jul-08 7:08 
QuestionEnable Apply button when needed Pin
JoZ CaVaLLo23-Jul-08 23:57
JoZ CaVaLLo23-Jul-08 23:57 
AnswerRe: Enable Apply button when needed Pin
Christian Graus24-Jul-08 0:03
protectorChristian Graus24-Jul-08 0:03 
AnswerRe: Enable Apply button when needed Pin
N a v a n e e t h24-Jul-08 0:07
N a v a n e e t h24-Jul-08 0:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.