Hi @S D_123 ,
C++/CLI project is different from C# project and you could not use EntityFramework
directly by adding other project references which include the EntityFramework
NuGet Package or dll
files.
You can try these steps:
1). Create a C++/CLI project > Add a new C# project to the same solution > Add NuGet Package to the C# project.
2). Go to the folder of C# project > copy the packages.config(I created a .net framework C# project) file to the C++/CLI project directory.
3). Add this packages.config file to your C++/CLI project in VS(from Solution Explorer > click Show All Files
button > right-click the packages.config > choose Include In Project
).
4). From your C++/CLI project > right-click Reference
> Add Reference > Browse > Browse and choose the related dll
files which are provided(located) by the C# project > Add > OK.
5). Then you can use C++/CLI syntax like using namespace XXXXX
to use it in your C++/CLI project.
Although this can make it work, there may exist some issues. For example, updating NuGet packages will be a little troublesome.
Best Regards,
Tianyu
- If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.