Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

CoreFx, CoreCLR 빌드 시 "error CS0518: Predefined type 'System.Object' is not defined or imported" 오류 해결 방법

CoreFx, CoreCLR 빌드 시에,

.NETCore = CoreFX + CoreCLR
; https://www.sysnet.pe.kr/2/0/2884

"Couldn't find a matching group" 또는 "error CS0518: Predefined type 'System.Object' is not defined or imported"라는 오류 메시지를 만날 수 있습니다.

E:\corefx>build.cmd
  Restoring build tools...
  System.Collections.Immutable -> E:\corefx\bin\Windows_NT.AnyCPU.Debug\System.Collections.Immutabl  e\System.Collections.Immutable.dll
E:\corefx\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00017\lib\packageresolve.targets(42,5): warning : Unable to resolve the assets of System.Runtime: Couldn't find a matching group [E:\corefx\src\Microsoft.Win32.Primitives\src\Microsoft.Win32.Primitives.csproj]
E:\corefx\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00017\lib\packageresolve.targets(42,5): warning : Unable to resolve the assets of System.Runtime.InteropServices: Couldn't find a matching group [E:\corefx\src\Microsoft.Win32.Primitives\src\Microsoft.Win32.Primitives.csproj]
E:\corefx\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00017\lib\packageresolve.targets(42,5): warning : Unable to resolve the assets of System.Resources.ResourceManager: Couldn't find a matching group [E:\corefx\src\Microsoft.Win32.Primitives\src\Microsoft.Win32.Primitives.csproj]
CSC : error CS0518: Predefined type 'System.Object' is not defined or imported [E:\corefx\src\Microsoft.Win32.Primitives\src\Microsoft.Win32.Primitives.csproj]
E:\corefx\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00017\lib\packageresolve.targets(42,5): warning : Unable to resolve the assets of System.ComponentModel: Couldn't find a matching group [E:\corefx\src\System.ComponentModel.Primitives\src\System.ComponentModel.Primitives.csproj]
E:\corefx\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00017\lib\packageresolve.targets(42,5): warning : Unable to resolve the assets of System.Resources.ResourceManager: Couldn't find a matching group [E:\corefx\src\System.ComponentModel.Primitives\src\System.ComponentModel.Primitives.csproj]
E:\corefx\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00017\lib\packageresolve.targets(42,5): warning : Unable to resolve the assets of System.Runtime: Couldn't find a matching group [E:\corefx\src\System.ComponentModel.Primitives\src\System.ComponentModel.Primitives.csproj]
CSC : error CS0518: Predefined type 'System.Object' is not defined or imported [E:\corefx\src\System.ComponentModel.Primitives\src\System.ComponentModel.Primitives.csproj]

build.cmd와 같은 폴더에 있는 msbuild.log 파일을 보면 csc.exe를 직접 실행할 수 있는 명령행 로그를 볼 수 있고, 이를 찾아 직접 실행해봐도 역시 마찬가지 오류가 발생하는 것을 확인할 수 있습니다.

// FrameworkPathOverride = C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7
// FrameworkRegistryBase = Software\Microsoft\.NETPortable
// HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\SupportedRuntimesForFxFamily\.NETPortable

cd E:\corefx\src\Microsoft.Win32.Primitives\src

E:\corefx\src\Microsoft.Win32.Primitives\src>"C:\Program Files (x86)\MSBuild\12.0\bin\Csc.exe" /noconfig /unsafe+ /nowarn:1701,1702 /nostdlib+ /define:DEBUG;TRACE;SIGNED /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7\mscorlib.dll" /debug+ /debug:full /delaysign+ /keyfile:E:\corefx\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00017\lib\MSFT.snk /optimize- /out:E:\corefx\bin\obj\Windows_NT.AnyCPU.Debug\Microsoft.Win32.Primitives\Microsoft.Win32.Primitives.dll /target:library /utf8output Interop\Interop.cs System\ComponentModel\Win32Exception.cs E:\corefx\src\Common\src\Interop\Windows\Interop.Libraries.cs E:\corefx\src\Common\src\Interop\Windows\mincore\Interop.FormatMessage.cs System\ComponentModel\Win32Exception.Windows.cs E:\corefx\bin\obj\Windows_NT.AnyCPU.Debug\Microsoft.Win32.Primitives\_AssemblyInfo.cs Microsoft (R) Visual C# Compiler version 12.0.31101.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.

error CS0518: Predefined type 'System.Object' is not defined or imported


이와 관련해서 검색해 보면, 다행히 답이 나옵니다. ^^

Corefx build fails when Xamarin PCL profiles are installed
; https://github.com/dotnet/corefx/issues/449

즉, Xamarin이 설치한 Portable Class Library에 대한 빌드 프로파일 설정이 영향을 미친 것입니다. 어쩔 수 없습니다. Xamarin 측이든 마이크로소프트든 이 문제를 해결하기 전까지는 Xamarin 측의 프로파일 파일을 제거해야 합니다.

그래도 Xamarin 제품을 설치 제거하는 것은 좀 그러하니... ^^; 다음과 같이 기존 Profile 폴더를 일단 백업 시켜 두고,

robocopy "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile" "e:\netportable_profile_backup" /S

이렇게 Xamarin.Android.xml, Xamarin.iOS.xml 파일을 삭제해 주시면 됩니다.

cd "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile"
del /s Xamarin.Android.xml
del /s Xamarin.iOS.xml

이후, 다시 cmd.exe 창을 띄우고 CoreClr, CoreFx의 build.cmd를 실행해 주면 Test 프로젝트까지 아주 깨끗하게 빌드되는 것을 확인할 수 있습니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 3/13/2015]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 166  167  168  169  170  171  172  173  174  175  176  177  [178]  179  180  ...
NoWriterDateCnt.TitleFile(s)
587정성태6/10/200828672VS.NET IDE: 56. C#에서 아쉬운 __DATE__, __TIME__ 매크로 [2]
586정성태6/4/200826301오류 유형: 56. WPF 디자이너 - The string was not recognized as a valid DateTime [2]
585정성태6/4/200834584.NET Framework: 101. WPF - ActiveX 컨트롤 호스팅하는 방법 [2]
582정성태5/16/200826350오류 유형: 55. Windowless ActiveX controls are not supported
580정성태4/24/200825418VC++: 34. 64비트 윈도우즈에서의 이벤트 후킹
579정성태4/24/200825242VC++: 33. 변환 후의 RGS 파일 내용을 얻는 방법
577정성태4/16/200826172.NET Framework: 100. XML Serializer를 이용한 값 복사 [5]
575정성태4/7/200823337오류 유형: 54. TFS Source Control - 명령을 사용할 수 없음 [2]
574정성태3/31/200821458오류 유형: 53. TFS 연결 오류 - The workspace [...] exists on computer [...]
573정성태3/25/200825488Windows: 31. TS Web Access와 UAC [1]
570정성태3/17/200824642오류 유형: 52. TFS 연결 오류 - TF31001 [2]
569정성태3/16/200825780Team Foundation Server: 24. TFS 2008로 마이그레이션 (2) [2]
566정성태2/28/200826923.NET Framework: 99. AppDomain.GetEntryAssembly()를 우회하는 방법파일 다운로드1
564정성태2/16/200826563Windows: 30. TS Web Access + Vista SP1 [2]
563정성태2/16/200825929오류 유형: 51. Vista(UAC) + 웹 프로젝트 디버깅: System.UnauthorizedAccessException
562정성태2/12/200830182Windows: 29. Windows Server 2008 설치 [4]
561정성태1/10/200823875오류 유형: 50. IE 7 + 잘못된 HTC 파일 경로 = File not found [5]
559정성태1/1/200828689Windows: 28. Vista에서 끌어다 놓기로 GAC 등록하는 방법 [2]
558정성태1/1/200845874개발 환경 구성: 33. 32bit/64bit OLE DB Provider [1]
557정성태12/22/200724217개발 환경 구성: 32. WSCF와 VS.NET 2008
556정성태12/16/200722299기타: 22. 인기 순위 정리 : 조회수 1000 회 이상
555정성태12/16/200725277기타: 21. 인기 순위 정리 : 조회수 500 ~ 999회 글 목록
554정성태12/16/200729665기타: 20. 인기 순위 정리 : 조회수 250 ~ 499회 글 목록
553정성태12/16/200730047기타: 19. 인기 순위 정리 : 조회수 100 ~ 249회 글 목록
552정성태12/16/200723658기타: 18. 인기 순위 정리 : 조회수 000 ~ 099 회 글 목록
550정성태12/16/200722870Team Foundation Server: 23. TFS 2005에서 TFS 2008로 마이그레이션 [2]
... 166  167  168  169  170  171  172  173  174  175  176  177  [178]  179  180  ...