add-type - creating exe file to run under older versions of dotnet


if use following code in powershell on computer dotnet v2.0.50727 installed
'helloworld.exe' file created.
if try , run on computers older versions of dotnet installed
running exe file produces .net framework initialization error saying
'you first must install 1 of following versions of .net framework:
  v2.0.50727'

how can use v2 machine (the 1 powershell installed) create exe file run on machine not have v2.0.50727 installed?
realise there might issues dotnet functionality across different versions
(but not code below)
@ least able try out.

code:

add-type -outputtype consoleapplication -outputassembly helloworld.exe @"
using system;

public class myprogram
{
    public static void main(string[] args) {
        console.writeline("hello world");
    }
}
"@

 

hi,

i think more of question development forum:

try post here : http://social.msdn.microsoft.com/forums/en/csharplanguage/threads

 

thanks

thiyagu


thiyagu | mcts/mcitp - exchange 2007 | mcse 2003[messaging] | http://www.myexchangeworld.com. posting provided "as is" no warranties, , confers no rights.


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Azure MFA with Azure AD and RDS

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com