2011-03-28 2 views
2

내 도메인 서비스를 추가했지만 웹 프로젝트를 빌드 할 때 DomainContext가 생성되지 않습니다. 나는 RIA 서비스에 익숙하지 않고 배우려고 노력하고 있지만 나는 정말로 붙어 있습니다. 여기 Silverlight 4 용 RIA 서비스에서 DomainContext가 생성되지 않습니다.

내 도메인 서비스입니다

Option Compare Binary 
Option Infer On 
Option Strict On 
Option Explicit On 


Imports System 
Imports System.Collections.Generic 
Imports System.ComponentModel 
Imports System.ComponentModel.DataAnnotations 
Imports System.Linq 
Imports System.ServiceModel.DomainServices.Hosting 
Imports System.ServiceModel.DomainServices.Server 
Imports Wellness.BL 
Imports System.Collections.ObjectModel 



'TODO: Create methods containing your application logic. 

<EnableClientAccess()> _ 
Public Class EventScheduleService 
    Inherits DomainService 

    Public Function GetEventSchedule(ByVal ScheduleYear As Integer) As IEnumerable(Of Models.EventSchedule) 
     Return DataServices.EventSchedulesDataService.GetEventSchedule(ScheduleYear) 
    End Function 

End Class 
+0

RIA 서비스 링크를 추가 했습니까? [방법 : RIA 서비스 링크 추가 또는 제거] (http://msdn.microsoft.com/en-us/library/ee707372(v=vs.91).aspx) – Kinnara

+0

Silverlight 프로젝트 속성의 실버 탭 및 WCF RIA 서비스 링크를 asp.net 웹 응용 프로그램 인 Wellness.Web으로 설정해야합니다. 이것은 내가 따라 가고자했던 블로그입니다 ... http : //msmvps.com/blogs/deborahk/archive/2009/11/05/silverlight-ria-services-and-your-business-objects.aspx? CommentPosted = 사실 # commentmessage – Spafa9

답변

0

어쩌면 Models.EventSchedule, 귀하는 IEnumerable의 기본 인 클래스, 당신은 웹 프로젝트에서 참조했지만에서 참조 할 수없는 라이브러리에 클라이언트는 Silverlight 라이브러리가 아니므로

클라이언트에서 EventScheduleDataContext가 생성되는 것을 방지 할 수 있다고 생각합니다.

간단한 테스트는 IEnumerable의 기본을 웹 프로젝트에있는 클래스로 변경하는 것입니다.

+0

RIA 서비스 클래스 라이브러리를 만들 수 있도록 프로젝트가 여러 응용 프로그램에서 사용되므로 일반 클래스 라이브러리를 사용하는이 블로그의 예제를 따르려고했습니다. 이 문제를 해결할 수 없다면 wcf 서비스를 사용하여 데이터를 호출해야합니다. http://msmvps.com/blogs/deborahk/archive/2009/11/05/silverlight-ria-services-and-your-business-objects.aspx?CommentPosted=true#commentmessage – Spafa9

+0

내 제안은 어떨까요? 간단한 테스트? – GilShalit

0

이 문제도 발생했습니다. 내 문제는 Visual Studio 릴리스 모드로 설정되어있었습니다. 디버그 모드로 설정하면 해결되었습니다.

관련 문제