Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Support SQL Server HierarchyId data type

$
0
0
zgabi wrote:
Hi,

In the nuget package you can find only the entityframework dlls, the tools which you try to use in VS is the original EF tools. It not supports hierarchyid. So you can do the following:
remove hierarhyid columns from DB, generate the EF codefirst model with the official EF power tools. Add hierarhyid columns manually to the code first model.

zgabi
Zgabi, I'm sorry, but it's still doesn't work :( I try to add hierarchyid column, but there's no such type in my Visual Studio. May be I need to do some additional actions to correctly install EF with hierarchyid? There's my steps to add EF with hierarchyid:
  1. Create a new MVC4 project (Empty template, .NET Framework 4.5)
  2. Go to NuGet Package Manager Console
  3. Type "Install-Package EntityFrameworkWithHierarchyId -Version 6.0.2", press Enter
  4. I have following messages (I have a Russian interface, so I translate messages manually):
"EntityFrameworkWithHierarchyId 6.0.2" successfully installed.
Adding "EntityFrameworkWithHierarchyId 6.0.2" to MvcApplication1.
"EntityFrameworkWithHierarchyId 6.0.2" successfully added to MvcApplication1.
Further, there're several errors like this
Exception when call "LoadFrom" with "1" argument: "Can't load file or package "EntityFramework.PowerShell.Utility, Version=6.0.0.0, Culture=neutral, PublicKeyToken=6847f3395fc61b47" либо одну из их зависимостей. Сбой при проверке правильности строгого имени. (Исключение из HRESULT: 0x8013141A)"
C:\Users\keyssser ekssselle\SkyDrive\разработка\MvcApplication1\packages\EntityFrameworkWithHierarchyId.6.0.2\tools\EntityFramework.psm1:669 знак:62
  • $utilityAssembly = [System.Reflection.Assembly]::LoadFrom <<<< ((Join-Path $ToolsPath EntityFramework.PowerShell.Utility.dll))
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : DotNetMethodException
That's all. After this I create a class Class1.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;

namespace MvcApplication1.Models
{
public class Class1
{
     HierarchyId tmp;    }
}
  1. Try to type Hierarchyid, but IntelliSence can't find this type. When I try to compile a project, error appears, that "HierarchyId type or assembly not found".
    Tell me, please, what's wrong in this scenario?

Viewing all articles
Browse latest Browse all 1793

Trending Articles



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