業務で使ったので備忘録。
以下のURLを参照。
http://cream-worker.blog.jp/archives/1062859618.html
注意点は自動でapp.config(もしくはweb.config)に設定される以下の部分の「oldVersion」と「newVersion」をNugetでインストールされたNpgsqlのバージョンに合わせること
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.7.0" newVersion="2.2.7.0" /> // <= ココのバージョンを合わせる
</dependentAssembly>
</assemblyBinding>
</runtime>
あと複合キーについてもメモ。
https://qiita.com/hahifu/items/58819f6f36433f20884d
以上。