richard
richard

Reputation: 196

EF 7 alpha 3: Azure Table Storage

I'm trying to get an example of EF 7 with Azure Table Storage to work in VS 14 CTP3, but I am having no luck with the dependency injection stuff. I was able to get an example with SQL done fairly easily, but I am seeing an issue that doesn't make sense: The referenced package is there and being pulled in, and if I look at it, it contains the correct namespaces, methods, clases etc., but the compile doesn't like it.

Here is my project.json:


    {
        "dependencies": {
            "Microsoft.AspNet.Server.IIS": "1.0.0-alpha3",
            "EntityFramework.AzureTableStorage": "7.0.0-alpha3",
            "Microsoft.AspNet.RequestContainer": "1.0.0-alpha3"
        },
        "frameworks" : {
            "net451" : { },
            "k10" : { }
        }
    }


    using System;
    using Microsoft.AspNet.Builder;
    using Microsoft.Data.Entity;  /* <- 'missing reference' unless I add EntityFramework to project.json */
    using Microsoft.Data.Entity.AzureTableStorage; /* <- ALWAYS errors w/ 'missing reference' */
    using Microsoft.Framework.DependencyInjection;


    namespace WebApplication2
    {
        public class Startup
        {
            public void Configure(IBuilder app)
            {
                app.UseServices(services =>
                {
                    services.AddEntityFramework()  /* <-- this errors too */
                        .AddAzureTableStorage();

                    services.SetupOptions<DbContextOptions> //,- says it can't find this
                        (config => config.UseAzureTableStorage("UseDevelopmentStorage=true"));
                });

            }
        }
    }

The strange thing is, if I right click and 'go to definition' on any of the 'missing' classes or methods, it brings them up, and I can see that I'm using them as defined. Am I missing something terribly obvious? Or is this stuff just not fully cooked yet?

Upvotes: 1

Views: 726

Answers (1)

kamehrot
kamehrot

Reputation: 91

Your project.json has both frameworks mentioned so VS builds both of them. If your intention is to just build for net451, you should remove the following from your project.json - "k10" : { }

Upvotes: 1

Related Questions