Example #1
0
        public IAwaiter Execute(uint argc, IntPtr argv)
        {
            var pBstrs = (IntPtr *)argv;

            string[] args = new string[argc];
            for (uint i = 0; i < argc; i++)
            {
                IntPtr thisBstr = pBstrs[i];
                if (thisBstr != IntPtr.Zero)
                {
                    args[i] = Marshal.PtrToStringBSTR(thisBstr);
                }
            }

            // Helios boots the DNX through this entry point. It has already
            // set up the AppDomain though, so we just need to sniff the target framework based
            // on the value provided by during AppDomain setup
            var fxName  = AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName;
            var version = new Version(4, 5, 1);

            if (!string.IsNullOrEmpty(fxName))
            {
                version = new FrameworkName(fxName).Version;
            }

            return(new Awaiter(RuntimeBootstrapper.ExecuteAsync(
                                   args,
                                   new FrameworkName(FrameworkNames.LongNames.Dnx, version))));
        }
Example #2
0
        public IAwaiter Execute(uint argc, IntPtr argv)
        {
            var pBstrs = (IntPtr *)argv;

            string[] args = new string[argc];
            for (uint i = 0; i < argc; i++)
            {
                IntPtr thisBstr = pBstrs[i];
                if (thisBstr != IntPtr.Zero)
                {
                    args[i] = Marshal.PtrToStringBSTR(thisBstr);
                }
            }

            return(new Awaiter(RuntimeBootstrapper.ExecuteAsync(args)));
        }