Run CORECLR under Windows compilation

Source: Internet
Author: User
Tags dotnet mscorlib

HelloWorld, who had been running Corefxlab before, failed to write down his own procedures with essays.

Operating system: Win8 Pro x64, processor AMD a8-3870. Installed VisualStudio Utimate,visualstudio Preview.

Reference Document: Https://github.com/dotnet/coreclr/wiki/Developer-Guide

Steps

1. Download cmake-3.2.0-rc2-win32-x86, install.

2. Pull the latest version of CORECLR.

3. Open developer Comand Prompt for 2014, switch to GIT/CORECLR directory, type [build clean]

This time with me in the company compiled results are not the same. This time the code compiles successfully and the test compilation fails.

The error log is

"D:\Git\coreclr\tests\build.proj" (Rebuild target) (1)
"D:\Git\coreclr\tests\src\dirs.proj" (Build target) (2)
"D:\Git\coreclr\tests\src\Regressions\assemblyref\assem.csproj" (Build target),
C:\Program Files (x86) \msbuild\microsoft\visualstudio\v12.0\appxpackage\microsoft.appxpackage.targets (451,9): Error APPX1639: The file "Windows.props" was not found. For more information, see http://go.microsoft.com/fwlink/?prd=12395&pver=1.0&plcid=0x409&ar=MSDN&sar= Platformmultitargeting&o1=c:\program Files (x86) \microsoft Sdks\portable\v12.0&o2=portable. [D:\Git\coreclr\tests\src\Regressions\assemblyref\assem.csproj]

But the compiled DLL seems normal. View Coreclr.dll with dependency. All dependent DLLs are x64. Only one IESHIMS.DLL is missing, which is searched from the Windows directory and copied to the current directory.

Dependency also reported a warning:

Warning:at least one module has the unresolved import due to a missing the export function in a delay-load dependent module.

4. Try running a. cmd under Type [Corerun test]

Hostlog:host directory:d:\git\coreclr\binaries\product\windows_nt.x64.debug\
Hostlog:core_root not set; Skipping
Hostlog:you can set the environment variable core_root to the path
Hostlog:where CoreCLR.dll lives to help CoreRun.exe find it.
Hostlog:attempting to Load:d:\git\coreclr\binaries\product\windows_nt.x64.deb
Ug\coreclr.dll
Hostlog:loaded:d:\git\coreclr\binaries\product\windows_nt.x64.debug\coreclr.d
ll
Hostlog:loading:d:\git\coreclr\binaries\product\windows_nt.x64.debug\text
Hostlog:finding getclrruntimehost (...)
Hostlog:calling getclrruntimehost (...)
Hostlog:setting ICLRRuntimeHost2 Startup Flags
Hostlog:starting ICLRRuntimeHost2
Hostlog:core_libraries not set; Skipping
Hostlog:you can set the environment variable core_libraries to point to a
Hostlog:path containing additional platform assemblies,
hostlog:adding assemblies from D:\Git\coreclr\binaries\Product\Windows_NT.x64.
Debug\ to the TPA list
Hostlog:Creating an AppDomain
Hostlog:trusted_platform_assemblies=d:\git\coreclr\binaries\product\windows_nt
. X64.debug\clretwrc.dll;d:\git\coreclr\binaries\product\windows_nt.x64.debug\cor
Eclr.dll;d:\git\coreclr\binaries\product\windows_nt.x64.debug\dbgshim.dll;d:\git
\coreclr\binaries\product\windows_nt.x64.debug\ieshims.dll;d:\git\coreclr\binari
Es\product\windows_nt.x64.debug\mscordaccore.dll;d:\git\coreclr\binaries\product
\windows_nt.x64.debug\mscordbi.dll;d:\git\coreclr\binaries\product\windows_nt.x6
4.debug\mscorlib.dll;d:\git\coreclr\binaries\product\windows_nt.x64.debug\mscorr
C.debug.dll;d:\git\coreclr\binaries\product\windows_nt.x64.debug\mscorrc.dll;d:\
Git\coreclr\binaries\product\windows_nt.x64.debug\sos.dll;d:\git\coreclr\binarie
S\product\windows_nt.x64.debug\coreconsole.exe;d:\git\coreclr\binaries\product\w
Indows_nt.x64.debug\corerun.exe;
Hostlog:app_paths=d:\git\coreclr\binaries\product\windows_nt.x64.debug\
Hostlog:app_ni_paths=d:\git\coreclr\binaries\product\windows_nt.x64.debug\ni;d
: \git\coreclr\binaries\product\windows_nt.x64.debug\
Hostlog:native_dll_search_directories=d:\git\coreclr\binaries\product\windows_
Nt.x64.debug\;D: \git\coreclr\binaries\product\windows_nt.x64.debug\
Hostlog:appdomaincompatswitch=uselatestbehaviorwhentfmnotspecified
Hostlog:app_local_winmetadata=

Unhandled Exception:System.IO.FileNotFoundException:Could not load file or
embly ' text ' or one of its dependencies. The system cannot find the file specified.

It looks like the runtime is running, which is not the same as the result of my last compilation. Is there a problem with the environment of my company's machine?

5. Try running Corefxlab under the HelloWorld

Https://github.com/dotnet/corefxlab

Home directory type [build]

The Nugettasks and HelloWorld are then compiled separately.
Run the generated HelloWorld.exe, prompting

This program cannot be started because Api-ms-win-core-localization-obsolete-|1-2-0.dll is missing from the computer. Try reinstalling the program to resolve the issue.

Had to compile Corefx

Https://github.com/dotnet/corefx/wiki/Developer-Guide

Remove the Api-ms-win-core-localization-obsolete-|1-2-0.dll under the generated Package folder to the HelloWorld directory. Run again, or the DLL is missing. Several attempts,

Copy the following DLLs together

Api-ms-win-core-kernel32-legacy-l1-1-1.dll

Api-ms-win-core-localization-l1-2-1.dll

Api-ms-win-core-localization-obsolete-l1-2-0.dll

Api-ms-win-core-stringloader-l1-1-1.dll

The final run was successful.

It seems that the failure to run a company is really related to the environment.

6. Try running HelloWorld with the compiled Corerun

Try two ways:

1) Copy the compiled HelloWorld entire folder to the CoreCLR compiled folder. Type[corerun Helloworld\hellowor

Ld.exe], error, reason unknown.

Unhandled Exception:System.BadImageFormatException:Could not load file or Asse
mbly ' HelloWorld.exe ' or one of its dependencies. The module was expected to con
Tain an assembly manifest.

2) Follow the http://blogs.msdn.com/b/dotnet/archive/2015/02/03/coreclr-is-now-open-source.aspx?Redirected=true&PageIndex=2 procedure:

Modify CoreCLR to your heart ' s content

Build CoreCLR viabuild.cmd x64 release

Copy the following files from coreclr\binaries\x64\release to corfxlab\demos\CoreClrConsoleApplications\HelloWorld\NotYetPackages\CoreCLR :coreclr.dll,CoreConsole.exe,mscorlib.dll

Rebuild HelloWorld.sln (either using the command line or in VS)

I do not know what the meaning of the test is really no effect.

Summarize:

There are a few more questions to figure out:
1. How to make HelloWorld.exe run on their own compiled coreclr.

2. Resolve the reasons why several test runs fail.

3. Compile coreclr missing IESHIMS.DLL, and compile HelloWorld missing "api-" the beginning of the DLL since it is necessary, why not directly in the packages provide?

Run CORECLR under Windows compilation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.