Unity 프로젝트에서 Unity가 기본적으로 컴파일하지 않는 .NET 클래스 라이브러리 API의 일부를 사용하는 경우 컴파일하는 동안 레퍼런스할 추가 어셈블리 리스트를 C# 컴파일러에 제공할 수 있습니다. 프로젝트에서 사용하는 .NET 프로파일에 따라 동작이 달라집니다. 자세한 내용은 .NET 프로파일 지원을 참조하십시오.
프로젝트에서 .NET Standard 프로파일을 사용하는 경우 .NET 클래스 라이브러리 API의 모든 부분을 기본적으로 레퍼런스합니다. 추가 어셈블리를 레퍼런스할 수 없습니다. API의 일부가 누락된 것 같으면 .NET Standard에 포함되지 않았을 수 있습니다. 대신 .NET Framework 프로파일을 사용할 수 있습니다. 프로파일 변경 시 컴파일 문제를 방지하려면 프로파일 간 전환을 참조하십시오.
기본적으로 Unity는 .NET Framework 프로파일을 사용할 때 다음 어셈블리를 레퍼런스합니다.
그 외의 클래스 라이브러리 어셈블리를 레퍼런스하려면 C# 컴파일러에 전달할 수 있는 커맨드 라인 인자 리스트가 포함된 응답 파일인 csc.rsp 파일을 사용합니다. csc.rsp 파일을 사용하려면 아래 지침을 따르십시오.
Assets
폴더에 csc.rsp라는 파일을 만듭니다.Assets
폴더로 이동합니다.예를 들어 System.Net.Http.dll
어셈블리에 정의된 HttpClient
클래스를 프로젝트에서 사용하는 경우 어셈블리가 없으면 C# 컴파일러에서 다음과 같은 초기 오류 메시지를 표시할 수 있습니다.
`HttpClient` 타입은 레퍼런스되지 않는 어셈블리에서 정의됩니다. 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 어셈블리에 대한 레퍼런스를 추가해야 합니다.
이 오류를 해결하려면 다음 커맨드 라인 인자가 포함된 csc.rsp 파일을 프로젝트에 추가합니다.
-r:System.Net.Http.dll
레퍼런스하려는 각 어셈블리에 대해 적절한 커맨드 라인 인자를 사용하여 새 라인을 추가합니다.
csc.rsp 파일을 사용하여 클래스 라이브러리 어셈블리를 레퍼런스하고 .NET 프로파일을 변경하면 컴파일 문제가 발생할 수 있습니다.
.NET 프로파일을 .NET Framework에서 .NET Standard로 변경하고 csc.rsp 파일이 .NET Standard 프로파일에 없는 어셈블리를 레퍼런스하면 컴파일이 실패합니다. 이 문제를 해결하려면 .NET 프로파일을 .NET Standard로 변경하기 전에 csc.rsp 파일을 편집하여 .NET Framework 프로파일 전용 어셈블리에 대한 레퍼런스를 제거합니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.