简体   繁体   中英

using entity framework in classlibrary

I am having problem in referencing entity framework 6 in my class library project. The project is registred for com interop. I have post build event like

SET GACUTIL="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\bin\\NETFX 4.5.1 Tools\\gacutil.exe" SET REGASM="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regasm.exe"

%REGASM% /u $(TargetFileName) /tlb:ClassLibrary1.tlb %GACUTIL% /u $(TargetFileName)

%REGASM% $(TargetFileName) /tlb:ClassLibrary1.tlb %GACUTIL% /i $(TargetFileName)

%REGASM% $(TargetFileName) /tlb:ClassLibrary1.tlb %GACUTIL% /i $(TargetFileName)

whenever I build I get error:

Cannot register assembly: "myassembly" Could not load file or assembly 'Entity Framework , Version 6.0.0.0

It looks like you didn't add entity framework assembly to your class library. Use the nuget console to install it: PM> Install-Package EntityFramework -Version 6.0.0

https://www.nuget.org/packages/EntityFramework/6.0.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM