반나절 동안 이곳 저곳을 검색해서 얻은 해법을 기록한다.

"LuaInterface"는 Lua 스크립트를 C#에서 사용할 수 있도록 제공하는 인터페이스이다.

관련되는 사이트의 주소는 다음과 같다.

1) LuaInterface in LuaForge: http://luaforge.net/projects/luainterface/
2) LuaInterface Source Code Homepage: http://code.google.com/p/luainterface/

사용하기 위해서는 LuaForge에서 다운로드 받은 후 "LuaInterface.dll"을 참조에 추가하면 된다.

Visual Studio 2010에서는 .net 4.0을 기본으로 프로젝트를 생성하기 때문에,
다운로드 받은 LuaInterface를 참조하여 사용하면 다음과 같은 에러 메시지를 출력한다.

에러 메시지

영문 메시지: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

한글 메시지: 혼합 모드 어셈블리는 런타임의 버전 'v2.0.50727'에 대해 빌드되며 추가 구성 정보 없이 '4.0' 런타임에 로드할 수 없습니다.

위 에러는 다음과 같은 방법으로 해결할 수 있다.

참고: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/5d1186ec-ad55-4929-b1e4-8806cdc758af

1. 해당 프로젝트의 "app.config" 파일을 연다.
2. 다음과 같이 작성한다.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
</configuration>


여기서 true로 설정한 useLegacyV2RuntimeActivationPolicy 속성이 CLR version 1.1/2.0 을 사용할 수 있게 해 주는 옵션이다.

LuaInterface는 CLR version 2.0으로 컴파일 되어 있기 때문에 이 옵션을 반드시 활성화 해 줘야 한다.

Posted by 하솔

2011/05/17 14:34 2011/05/17 14:34
, , ,
Response
No Trackback , No Comment
RSS :
http://blog.hasol.net/rss/response/398


블로그 이미지

스스로의 경제학..

- 하솔

Notices

Archives

Authors

  1. 하솔

Calendar

«   2012/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Site Stats

Total hits:
176675
Today:
51
Yesterday:
59