Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

VS 2013 enable-migrations Issue - Project not found

$
0
0

1. File --> New Website --> Empty Website --> Test_CACS
2. Created new DbContext 

namespace Test_CACS
{
    using System;
    using System.Data.Entity;
    using System.Linq;

    public class Test_CACSContext : DbContext
    {

        public Test_CACSContext()
            : base("name=Test_CACSContext")
        {
        }

3. Created an Employee class - simplified version show

namespace Test_CACS
{
    [Table("Employees")]
    public class Employee : IValidatableObject
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public int Employee_Id { get; set; }

        public string Employee_First_Name { get; set; }

        public string Employee_Last_Name { get; set; }

    }

4. Installed EF thru 'Manage Nuget Packages for the solution"

5. The working directories are all on my c: drive which I have permissions to.

6. Package Manager Console ---> enable-migrations --> Error occurs

PM> Enable-Migrations -ContextTypeName "Test_CACS" -StartupProjectName "Test_CACS" -verbose
Get-Project : Project 'Test_CACS' is not found.
At C:\Users\50013135\Documents\Visual Studio 2013\Projects\Test_CACS\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:950 char:27
+ $project = Get-Project <<<< $name
+ CategoryInfo : ObjectNotFound: (Test_CACS:String) [Get-Project], ItemNotFoundException
+ FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PowerShell.Commands.GetProjectCommand

Cannot determine a valid start-up project. Using project 'http://localhost/Test_CACS/' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information.

I placed the Employees class and Test_CACSContext in a Modelds folder

Not sure why it can't find the project where EF was installed.

 


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>