tombrothers / VfpEntityFrameworkProvider2

Visual FoxPro Entity Framework Provider for EF6
25 stars 11 forks source link

Couldnt Get Started #19

Open rubenrovira opened 3 years ago

rubenrovira commented 3 years ago

Hi Tom! Congrats about the projects. I am very exited to test it on. I am getting some troubles on creating a project using VS2015 + .Net 4.6.1 1) Create a Console App 2) Install the VFPEntityFramewrokProvider2 from the nuget package admin The installation complete seccessfully but it doesnt add the provider into the App.Condig (I can do it manually) and also cant fount the msi in the packages folder. I tried to follow the steps in https://randomdevnotes.com/2013/12/15/visual-foxpro-entity-framework-provider-v2-getting-started-using-the-ef-designer/ I can downloaded a msi and installed it, but after that, when I try to add a new “ADO.NET Entity Data Model”, after compile the project, exit VS and enter again, I can found VFP Entity Framework Provider in I tryied many times starting from scratch but I can get success

mPisano commented 3 years ago

I'm not sure the most recent build has the wizard to reverse engineer tables if that's what you mean by "Data model", that feature was dropped as the newer builds are for 2017/19 and Core. Since you on 2015, try older builds that had VS Shell integration.

also Have you looked at VfpEFQuerySamples.zip on the Main page?

rubenrovira commented 3 years ago

Hi Mike! Thanks by your answer! No, I am on VS2019 but i went to VS2015 in order to could follow the steps in the blog. Back in 2019 I will try to manage it. I will download the VfpEFQuerySamples.zip and I will try to follow it as a guide. Just two more questions: 1) I still need to install the msi in 2019 with the last nuget package? 2) Is there any updated guide (step by step) I can follow? best regards

mPisano commented 3 years ago

You need to instal as Admin for all users the VFPEFP2 msi or you need to the Microsoft VFPOledb MSI (which is in the VFPEFP2 msi) if you use the VFPEF2 then dlls are registered too.

I just run the FoxOleDB msi and put VFPCLIENT.dll and VFPEFProvidef.dll in my BIN Directories and added to the app.config as below. < add name="FoxDbContext" providerName="VfpEntityFrameworkProvider2" connectionString="data source={0};deleted=True;null=False;enginebehavior=90;CODEPAGE=1252;" />'

    <entityFramework>
    <providers>
        <provider invariantName="VfpEntityFrameworkProvider2" type="VfpEntityFrameworkProvider.VfpProviderServices, VfpEntityFrameworkProvider" />
    </providers>
</entityFramework>

<system.data>
    <DbProviderFactories>
        <clear />
        <add name="Vfp Entity Framework Provider" invariant="VfpEntityFrameworkProvider2" description="Vfp Entity Framework Provider" type="VfpEntityFrameworkProvider.VfpProviderFactory, VfpEntityFrameworkProvider" />
    </DbProviderFactories>
</system.data>

Keep in mind the connection string DataSource is either the Path to the free table directory or the fullpath to the DBC. Besides that define your poco's and entities and write your Linq queries.

HTH Mike