소개
휴대용 클래스 라이브러리 문제는 Microsoft Visual Studio 2012 업데이트 2를 설치한 후 발생할 수 있습니다. 이러한 문제와 그 해결 방법을 설명합니다.
문제 1
증상
리소스를 사용 하 여 Visual Studio 2012 업데이트 2를 설치한 후 이식 가능한 클래스 라이브러리 프로젝트를 빌드할 때 다음과 같은 오류 메시지가 나타날 수 있습니다.
'System.Type' 'Assembly'에 대 한 정의 포함 하지 않으며 'Assembly' 형식 'System.Type'의 첫 번째 인수를 받아들이는 확장 메서드 없음 찾을 수 없습니다 (using 누락 된 지시문 또는 어셈블리 참조가?)
참고: Microsoft Visual C#를 사용할 때이 오류가 나타납니다.
'Assembly' 'System.Type'의 멤버가 아닙니다.
참고: Microsoft Visual Basic 사용 하는 경우이 오류가 나타납니다.
프로젝트의 대상으로 다음 플랫폼 중 하나이 문제가 발생 합니다.
-
4.5 Microsoft.NET Framework 및.NET Windows 저장소 응용 프로그램
-
4.5.NET Framework 및 Windows Phone 8
-
.NET Framework.NET Windows 저장소 응용 프로그램 및 Windows Phone 8 4.5
해결 방법
이 문제를 해결 하려면 리소스 파일의 디자이너에서 생성 된 코드를 수정 합니다. 이렇게 하려면 오류 메시지를 두 번 클릭 하 고이 단계를 수행:
C#에 대 한
-
다음 코드를 추가 지시문을 사용 하 여:
using System.Reflection;
-
다음 코드를 찾습니다.
typeof(Resource1).Assembly
해당 코드를 다음 코드로 바꿉니다.
typeof(Resource1).GetTypeInfo().Assembly
다음 코드는이 문제를 예:
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]internal static global::System.Resources.ResourceManager ResourceManager { get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PortableClassLibrary2.Resource1", typeof(Resource1).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
Visual Basic
-
다음 코드를 추가 지시문을 사용 하 여:
Imports System.Reflection;
-
다음 코드를 찾습니다.
GetType(Resource1).Assembly
해당 코드를 다음 코드로 바꿉니다.
GetType(Resource1).GetTypeInfo().Assembly
다음 코드는이 문제를 예:
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("PortableClassLibrary1.Resource1", GetType(Resource1).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
문제 2
증상
이식 가능한 클래스 라이브러리 프로젝트를 Visual Studio 2012 업데이트 2를 설치한 후 만들려는 리소스를 사용할 수 없습니다. 또한, 여러 가지 다른 오류 메시지 중 하나가 나타날 수 있습니다. 예를 들어, 다음과 같은 오류 메시지 중 하나가 나타날 수 있습니다.
'System.Net.HttpStatusCode' 형식이 참조 되지 않은 어셈블리에 정의 됩니다. 어셈블리에 대 한 참조를 추가 해야 ' System.Net, 버전 2.0.5.0, Culture = = 중립, publickeytoken 등 7cec85d7bea7798e, Retargetable = = 예의.
'System.Net.HttpStatusCode' 형식으로 암시적으로 변환할 수 ' System.Net.HttpStatusCode [%programfiles%\Reference Assemblies\Microsoft\Framework\. NETPortable\v4.5\Profile\Profile78\System.Net.Primitives.dll]'
Note 프로젝트의 대상으로 다음 플랫폼 중 하나에 경우이 문제가 발생 합니다.
-
4.5.NET Framework 및 Windows Phone 8
-
.NET Framework.NET Windows 저장소 응용 프로그램 및 Windows Phone 8 4.5
원인
Windows Phone 소프트웨어 개발 키트 (SDK) 8.0을 설치한 후 Visual Studio 2012 업데이트 2를 설치한 경우이 문제가 발생 합니다. 따라서 다음 파일을 삭제 했습니다.
-
%programfiles%\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile49\System.Net.dll
-
%programfiles%\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile49\System.ServiceModel.dll
-
%programfiles%\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78\System.Net.dll
-
%programfiles%\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78\System.ServiceModel.dll
해결 방법
이 문제를 해결 하려면 Visual Studio 2012 복구 프로그램을 실행 합니다. 이렇게 하려면, 다음 단계를 수행하십시오.
-
시작, 제어판, 프로그램및 다음 프로그램 및 기능을클릭 합니다.
-
설치 된 Visual Studio 2012 버전을 마우스 오른쪽 단추로 클릭 하 고 변경을 클릭 합니다.
-
Visual Studio 2012 설치 마법사가 열리면 복구 를 클릭 합니다.
참고: 새 개발자 환경을 설정 하면 이러한 문제를 방지 하기 위해 설치 해야 Visual Studio 2012 업데이트 2 8.0 Windows Phone SDK를 설치 하기 전에.
상태
Microsoft는 이 문제가 '적용 대상' 섹션에 나열된 Microsoft 제품의 문제임을 확인했습니다.