내 C# 프로젝트에 SQLite는 (SQLite.NET)를 추가하는 방법 :나는 설명서의 지침을 따라
시나리오 1 : 버전 독립적 인 (전역 어셈블리 캐시를 사용하지 않습니다)
이 방법을 사용하면 버전의 System.Data.SQLite.DLL 을 응용 프로그램의 폴더에 넣고 코드를 수정하거나 을 다시 컴파일하지 않고 을 사용할 수 있습니다. 당신의 app.config 파일에 다음 코드 를 추가
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite"
description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
</configuration>
내 app.config 파일은 이제 다음과 같습니다
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="DataFeed.DataFeedSettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<DataFeed.DataFeedSettings>
<setting name="eodData" serializeAs="String">
<value>False</value>
</setting>
</DataFeed.DataFeedSettings>
</userSettings>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider"
invariant="System.Data.SQLite"
description=".Net Framework Data Provider for SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
</configuration>
내 프로젝트 "의 datafeed"라고합니다 :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite; //<-- Causes compiler error
namespace DataFeed
{
class Program
{
static void Main(string[] args)
{
}
}
}
오류는 다음과 같습니다.
\ DEV \의 datafeed Program.cs \ (5,19). 오류 CS0234 : 'SQLite는'이 네임 스페이스 'System.Data'에 존재하지 않는 이름 (있는 형식 또는 네임 스페이스 당신 어셈블리 누락 참조?)
나는 해요 GAC 그래서 난 단순히 내 .\dev\DataFeed\
폴더에 System.Data.SQLite.dll
를 떨어 사용하지 않으. 필자는 문서에서 언급 한 것처럼 DLL을 프로젝트 폴더에 추가하는 것으로 생각했지만 라이브러리를 사용할 수는 없다고 생각했습니다. 실제로이 작업을 수행하는 방법에 대한 힌트가 있습니까?
Doh! 웃음, 나는 실패한다! 도움을 주셔서 감사합니다 ... 지금 작동 중입니다! – Kiril
@Lirik : 때때로 그것은 당신의 방식으로 들어가고 당신 자신이 그것을 볼 수없는 간단한 것들입니다 :-) 거기에 있었고, 경험했습니다 .... –
나는 그것이 1:00에 일어난다 고 생각합니다. :) ... 두뇌는 잠자는 것에 대해 생각하기 시작하고 나는 개발에 대해 생각하라고 여전히 요청하고 있습니다. – Kiril