Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

NET 3 Usage?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 11-07-2006   #1 (permalink)
Flowering Weeds
Guest


 

NET 3 Usage?


Any one running .NET 3 and PowerShell?

Version: 3.0
Date Published: 11/6/2006

Download details: Microsoft .NET Framework 3.0 Redistributable Package
http://www.microsoft.com/downloads/d...displaylang=en





My System SpecsSystem Spec
Old 11-07-2006   #2 (permalink)
dreeschkind
Guest


 

RE: NET 3 Usage?

Yep.

--
greetings
dreeschkind

"Flowering Weeds" wrote:

>
> Any one running .NET 3 and PowerShell?
>
> Version: 3.0
> Date Published: 11/6/2006
>
> Download details: Microsoft .NET Framework 3.0 Redistributable Package
> http://www.microsoft.com/downloads/d...displaylang=en
>
>
>
>
>

My System SpecsSystem Spec
Old 11-07-2006   #3 (permalink)
Maximilian Hänel
Guest


 

Re: NET 3 Usage?

Hi,

> Any one running .NET 3 and PowerShell?


Yes. btw .Net 3.0 isn't really a new version. It's still Version 2.0
(e.g. there's no system.dll version 3.0) with new dlls added so I don't
see there any problems running PS with V3.0.
There were lots of debates regarding the new version number and IMHO it
better would be named .Net 2.5. The irony is that the next real new
version is probably 3.5. A perfect confusion... ;-)

cu

Max
My System SpecsSystem Spec
Old 11-07-2006   #4 (permalink)
Flowering Weeds
Guest


 

Re: NET 3 Usage?


"Maximilian Hänel"

> Hi,
>
>> Any one running .NET 3 and PowerShell?

>
> Yes. btw .Net 3.0 isn't really a new version. It's still Version 2.0
> (e.g. there's no system.dll version 3.0) with new dlls added so I
> don't see there any problems running PS with V3.0.
> There were lots of debates regarding the new version number and IMHO
> it better would be named .Net 2.5. The irony is that the next real
> new version is probably 3.5. A perfect confusion... ;-)
>


Yep, but

Just to confirm - got any NET 3
class usage examples?




My System SpecsSystem Spec
Old 11-08-2006   #5 (permalink)
Keith Hill [MVP]
Guest


 

Re: NET 3 Usage?

"Flowering Weeds" <floweringnoweedsno@hotmail.com> wrote in message news:Ov1ySMrAHHA.3396@TK2MSFTNGP02.phx.gbl...
> Yep, but
>
> Just to confirm - got any NET 3
> class usage examples?


The following is using the self-hosted WCF service app that you get when you install the latest Windows SDK:

http://www.microsoft.com/downloads/d...displaylang=en

After you have installed .NET FX 3.0 runtime and the above SDK, extract the WCFSamples.zip file in place. The ZIP file is located in:

C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples

Then open this solution:

C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\TechnologySamples\Basic\Service\Hosting\SelfHost\CS\SelfHost.sln

and set the Service as the startup project and run the service.

Now open up the PowerShell prompt. Before doing anything else you will need to have the environment configured to compile using the C# 2.0 compiler. See my blog post on how to do that:

http://keithhill.spaces.live.com/blog/cns!5A8D2641E0963A97!512.entry

Now execute the following from the directories indicated. Note: on 7# you may need to execute it twice if it fails the first time because of your firewall. I had to unblock it via Windows Live One Care and execute that command again to get it to work.


--------------------------------------------------------------------------------
[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
7# .\svcutil.exe http://localhost:8000/ServiceModelSamples/service?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://localhost:8000/ServiceModelSamples/
service?wsdl' using WS-Metadata Exchange or DISCO.
Generating files...
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\CalculatorService.cs
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\output.config

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
10# csc /t:library CalculatorService.cs /r:"C:\Program Files\Reference Assemblie
s\Microsoft\Framework\v3.0\System.ServiceModel.dll"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

28# [Reflection.Assembly]::LoadWithPartialName("System.ServiceModel")

GAC Version Location
--- ------- --------
True v2.0.50727 C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0...

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
32# [Reflection.Assembly]::LoadFrom("$pwd\CalculatorService.dll")

GAC Version Location
--- ------- --------
False v2.0.50727 C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\Calcu...

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
47# $wsHttpBinding = new-object System.ServiceModel.WSHttpBinding

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
48# $endpoint = new-object System.ServiceModel.EndpointAddress("http://localhost
:8000/ServiceModelSamples/service")

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
61# $calcService = new-object CalculatorClient($wsHttpBinding, $endpoint)

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
63# $calcService.Add(3,4)
7

--------------------------------------------------------------------------------


OK there it is. Nothing too exciting in terms of the results but hey we have PowerShell working with .NET 3.0, specifically Windows Communication Foundation. Pretty cool!

One additional note, it seems that using the preferred method to specify bindings and endpoint addresses (app config files) isn't going to work to well unless you're comfortable creating an PowerShell.exe.config file and dropping it in $PSHome. That seems a gross hack to me. At least we can specify these explicitly in PowerShell.

--
Keith Hill

My System SpecsSystem Spec
Old 11-08-2006   #6 (permalink)
Lee Holmes [MSFT]
Guest


 

Re: NET 3 Usage?

An easier way to wrap these environment-customizing batch files is here:

http://www.leeholmes.com/blog/Nothin...hnologies.aspx

--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Keith Hill [MVP]" <r_keith_hill@mailhot.moc.nospam> wrote in message
news:eXIYdA2AHHA.4892@TK2MSFTNGP04.phx.gbl...
"Flowering Weeds" <floweringnoweedsno@hotmail.com> wrote in message
news:Ov1ySMrAHHA.3396@TK2MSFTNGP02.phx.gbl...
> Yep, but
>
> Just to confirm - got any NET 3
> class usage examples?


The following is using the self-hosted WCF service app that you get when you
install the latest Windows SDK:

http://www.microsoft.com/downloads/d...displaylang=en

After you have installed .NET FX 3.0 runtime and the above SDK, extract the
WCFSamples.zip file in place. The ZIP file is located in:

C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples

Then open this solution:

C:\Program Files\Microsoft
SDKs\Windows\v6.0\Samples\TechnologySamples\Basic\Service\Hosting\SelfHost\CS\SelfHost.sln

and set the Service as the startup project and run the service.

Now open up the PowerShell prompt. Before doing anything else you will need
to have the environment configured to compile using the C# 2.0 compiler.
See my blog post on how to do that:

http://keithhill.spaces.live.com/blog/cns!5A8D2641E0963A97!512.entry

Now execute the following from the directories indicated. Note: on 7# you
may need to execute it twice if it fails the first time because of your
firewall. I had to unblock it via Windows Live One Care and execute that
command again to get it to work.


--------------------------------------------------------------------------------
[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
7# .\svcutil.exe http://localhost:8000/ServiceModelSamples/service?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from
'http://localhost:8000/ServiceModelSamples/
service?wsdl' using WS-Metadata Exchange or DISCO.
Generating files...
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\CalculatorService.cs
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\output.config

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
10# csc /t:library CalculatorService.cs /r:"C:\Program Files\Reference
Assemblie
s\Microsoft\Framework\v3.0\System.ServiceModel.dll"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

28# [Reflection.Assembly]::LoadWithPartialName("System.ServiceModel")

GAC Version Location
--- ------- --------
True v2.0.50727
C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0...

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
32# [Reflection.Assembly]::LoadFrom("$pwd\CalculatorService.dll")

GAC Version Location
--- ------- --------
False v2.0.50727 C:\Program Files\Microsoft
SDKs\Windows\v6.0\Bin\Calcu...

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
47# $wsHttpBinding = new-object System.ServiceModel.WSHttpBinding

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
48# $endpoint = new-object
System.ServiceModel.EndpointAddress("http://localhost
:8000/ServiceModelSamples/service")

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
61# $calcService = new-object CalculatorClient($wsHttpBinding, $endpoint)

[C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin]
63# $calcService.Add(3,4)
7

--------------------------------------------------------------------------------


OK there it is. Nothing too exciting in terms of the results but hey we
have PowerShell working with .NET 3.0, specifically Windows Communication
Foundation. Pretty cool!

One additional note, it seems that using the preferred method to specify
bindings and endpoint addresses (app config files) isn't going to work to
well unless you're comfortable creating an PowerShell.exe.config file and
dropping it in $PSHome. That seems a gross hack to me. At least we can
specify these explicitly in PowerShell.

--
Keith Hill


My System SpecsSystem Spec
Old 11-08-2006   #7 (permalink)
Keith Hill [MVP]
Guest


 

Re: NET 3 Usage?

"Lee Holmes [MSFT]" <lee.holmes@online.microsoft.com> wrote in message
news:%2320wgT2AHHA.4592@TK2MSFTNGP03.phx.gbl...
> An easier way to wrap these environment-customizing batch files is here:
>
> http://www.leeholmes.com/blog/Nothin...hnologies.aspx


That is very handy! Thanks. However you guys need to tweak the Windows SDK
and Visual Studio folks for not providing the equivalent PowerShell scripts:
SetEnv.ps1 and vsvars32.ps1. :-)

--
Keith

My System SpecsSystem Spec
Old 11-08-2006   #8 (permalink)
Flowering Weeds
Guest


 

Re: NET 3 Usage?


>> Yep, but
>>
>> Just to confirm - got any NET 3
>> class usage examples?


"Keith Hill [MVP]"

> The following is using the self-hosted
> WCF service app


Snip

> OK there it is. Nothing too exciting in
> terms of the results but hey we have
> PowerShell working with .NET 3.0,
> specifically Windows Communication
> Foundation. Pretty cool!


Thanks for confirming that PowerShell
loads and uses them!



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU Usage The Toastmaster Vista mail 2 04-29-2008 07:31 AM
CPU Usage...100% Rod Davies Vista General 9 05-01-2007 11:25 AM
CPU usage still James Bailey Vista mail 8 04-12-2007 09:33 AM
WMP 11 CPU usage Khan Vista music pictures video 2 03-23-2007 02:27 AM
CPU usage 100% ChrisJ Vista performance & maintenance 20 02-19-2007 10:40 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51