PowerShell and .NetMap

Aug 30, 2008 at 2:14 PM

I wanted to try out loading NetMap into PowerShell and do some exploration.

[Reflection.Assembly]::Loadfrom("c:\downloads\microsoft\NetMap\Application Files\lib\Microsoft.NetMap.Control.dll") | Out-Null
[Reflection.Assembly]::Loadfrom("c:\downloads\microsoft\NetMap\Application Files\lib\Microsoft.NetMap.Visualization.dll") | Out-Null

New-Object Microsoft.NetMap.Visualization.NetMapControl


Running gives this error

format-default : The member "Layout" is already present.

I am guessing it may be this line in NetMapControl.cs

public

 

new ILayout Layout

 

Aug 30, 2008 at 7:29 PM
The "new" keyword is required by the compiler to distinguish between the base-class Windows.Forms.Control.Layout event and the NetMapControl.Layout property.  I don't know enough about PowerShell and the reflection tricks it uses to know why this is causing a problem.

If it's important enough to you, I suppose you could download the source code and rename the NetMapControl.Layout property to something else.  I don't want to do that in the official version of the code because the word "layout" is an integral part of NetMap's visualization namespace.

-- Tony
Aug 30, 2008 at 9:24 PM
Thanks Tony.

I've been working with PowerShell for a while and it is the first time I've seen a DLL complain like this.
I have downloaded the source and have been playing with it to get some clues.

I did see the inheritance tree for the NetMapControl.

Very unusual.

Doug

blog: Development In a Blink





From: notifications@codeplex.com
To: finked@hotmail.com
Date: Sat, 30 Aug 2008 11:29:44 -0700
Subject: Re: PowerShell and .NetMap [NetMap:34606]


.ExternalClass {font-family:Verdana;font-size:0.75em;} .ExternalClass #EC_ThreadNotificationFooter {border-top:1px solid #ccc;color:gray;} .ExternalClass #EC_ThreadNotificationPostBody {margin-bottom:2em;} .ExternalClass {font-family:Verdana;font-size:0.75em;} .ExternalClass #EC_ThreadNotificationFooter {color:gray;border-top:1px solid #ccc;} .ExternalClass #EC_ThreadNotificationPostBody {margin-bottom:2em;} From: tcap479
The "new" keyword is required by the compiler to distinguish between the base-class Windows.Forms.Control.Layout event and the NetMapControl.Layout property. I don't know enough about PowerShell and the reflection tricks it uses to know why this is causing a problem.

If it's important enough to you, I suppose you could download the source code and rename the NetMapControl.Layout property to something else. I don't want to do that in the official version of the code because the word "layout" is an integral part of NetMap's visualization namespace.

-- Tony
Read the full discussion online.
To add a post to this discussion, reply to this email (NetMap@discussions.codeplex.com)
To start a new discussion for this project, email NetMap@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Get thousands of games on your PC, your mobile phone, and the web with Windows®. Game with Windows
Aug 30, 2008 at 9:32 PM
Doug:

If you manage to figure out why the duplicate names cause PowerShell to complain, please let us know.

Thanks,
    Tony
Aug 31, 2008 at 6:16 PM

Problem seems to be in Version 2 of PowerShell.

Version 1 does not get the error.

I'll follow up with someone on the PowerShell team.




From: notifications@codeplex.com
To: finked@hotmail.com
Date: Sat, 30 Aug 2008 13:32:54 -0700
Subject: Re: PowerShell and .NetMap [NetMap:34606]


.ExternalClass {font-family:Verdana;font-size:0.75em;} .ExternalClass #EC_ThreadNotificationFooter {border-top:1px solid #ccc;color:gray;} .ExternalClass #EC_ThreadNotificationPostBody {margin-bottom:2em;} .ExternalClass {font-family:Verdana;font-size:0.75em;} .ExternalClass #EC_ThreadNotificationFooter {color:gray;border-top:1px solid #ccc;} .ExternalClass #EC_ThreadNotificationPostBody {margin-bottom:2em;} From: tcap479
Doug:

If you manage to figure out why the duplicate names cause PowerShell to complain, please let us know.

Thanks,
Tony
Read the full discussion online.
To add a post to this discussion, reply to this email (NetMap@discussions.codeplex.com)
To start a new discussion for this project, email NetMap@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Get ideas on sharing photos from people like you. Find new ways to share. Get Ideas Here!