방금 WebMatrix에서 작업하기 시작했습니다. 기본을 배우기 위해 this 자습서를 작성한 다음 this으로 시작했는데 WebMatrix에서 Entity Framework를 시작했습니다. (참고 :이 자습서는 WebMatrix 용입니다. 1,하지만 당신이 당신의 프로젝트에 도우미를 설치하는 방식이 바뀌었다.) 것은, Entity Framework 도우미를 설치했지만, 내 프로젝트가 EntityFramework.dll을 인식하지 못합니다.WebMatrix 2가 EntityFramework 도우미를 인식하지 못함
이 오류가 발생합니다. The type or namespace name 'MaxLength' could not be found (are you missing a using directive or an assembly reference?)
. 그러나 EntityFramework.dll이 내 bin 폴더에 표시됩니다. 어떻게됩니까? 나는 왜 참조가 작동하지 않는지 이해하지 못한다.
이것은 두 번째 튜토리얼에와 EntityFramework 도우미를 설치 한 후 따라 내 Web.config 파일 :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.0"><assemblies><add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></assemblies></compilation>
</system.web>
<connectionStrings>
<add name="BookContext" connectionString="Data Source=|DataDirectory|Books.sdf" providerName="System.Data.SqlServerCe.4.0" />
</connectionStrings>
</configuration>
이 link
내가 뭔가를 놓치고 있습니까 컴파일러의 출력은? 내 프로젝트에서 EntityFramework.dll이 제대로 인식되지 않는 이유는 무엇입니까?
UPDATE
내가 비주얼 스튜디오 2012에서 만든 웹 페이지의 프로젝트에서 EntityFramework.dll를 복사 할 때 문제가 해결되었다 생각하지만, 오류가 더 이상 표시되지 않은 경우에도, WebMatrix는 아직하지 않습니다
나는 정말로 이해하지 못한다. 간단한 데이터베이스가 생성되었지만 EntityFramework 어노테이션을 사용하여 데이터베이스에 필요한 모든 것을 지정할 수는 없다. WebMatrix는 EntityFramewor.dll을 인식해야하지만 그렇지 않습니다. 나는 정말로 잃어 버렸기 때문에 나는이 도움을 필요로한다.
MaxLengthAttribute는 System.ComponentModel.DataAnnotations.dll 어셈블리에 있습니다. http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.maxlengthattribute.length.aspx – Pawel
Entity Framework에도 MaxLengthAttribute가 있습니다. http://msdn.microsoft.com/en-us/ library/system.componentmodel.dataannotations.maxlengthattribute % 28v = 1010 % 29.aspx –
예, EntityFramework에 살았지 만 System.ComponentModel.DataAnnotations – Pawel