Windows 서비스 인터페이스로 silverlight를 사용하고 싶습니다. 이를 위해 xap 파일을 제공하기 위해 사용자 지정 웹 서버를 사용하고 있으며 정상적으로 작동합니다.IIS없이 Silverlight RiaServices를 사용할 수 있습니까?
이제 RiaServices를 사용하고 싶지만 물론 관련된 IIS가 없습니다.
[EnableClientAccess]
public class TestDomainService : DomainService {
public IQueryable<Foo> GetPontos() {
List<Foo> list = new List<Foo>();
list.Add(new Foo {Id = 1});
return list.AsQueryable();
}
}
public class Foo {
[Key]
public int Id { get; set; }
public string Name { get; set; }
}
그리고 프로그램 :
static void Main(string[] args) {
DomainServiceHost host = new DomainServiceHost(typeof(TestDomainService), new Uri("http://0.0.0.0:8099/TestDomainService"));
host.Open();
}
당신은 빈 cmd를 응용 프로그램에서이 코드를 사용할 수 있습니다 당신이 플레이를 공격하면, 런타임 예외가 발생합니다 :
여기 내 코드입니다System.TypeAccessException 처리되지 않았습니다. 메시지 = 보안 투명 메서드 'System.ServiceModel.DomainServices.Server.DomainTypeDescriptionProvider.GetForeignKeyMembers()'에 의해 시도되었습니다. ccess 보안 중요 유형 인 System.ComponentModel.DataAnnotations.AssociationAttribute '가 실패했습니다. 어셈블리 'System.ComponentModel.DataAnnotations, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35'는 현재 AppDomain에서 사용할 수없는 조건부 APTCA 어셈블리입니다. 응용 프로그램 도메인을 만들 때 부분 신뢰 또는 보안 투명 코드에 의해 사용되는이 어셈블리를 사용하려면하여 PartialTrustVisibleAssemblies 목록에 어셈블리 이름 ', 한 PublicKey = 0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9 System.ComponentModel.DataAnnotations'를 추가하시기 바랍니다. 출처 = System.ServiceModel.DomainServices.Server 유형 이름 = "" 스택 트레이스 : System.ServiceModel.DomainServices.Server.DomainTypeDescriptionProvider.GetForeignKeyMembers에서 () System.ServiceModel.DomainServices.Server.DomainTypeDescriptionProvider.GetTypeDescriptor에서 (유형 objectType의,) System.ServiceModel.DomainServices.Server.DomainServiceDescription.AddEntityType에서 System.ComponentModel.TypeDescriptor.GetProperties에서 System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties에서 () (유형 componentType가) 을 객체 인스턴스 (형식 entityType) at System.ServiceModel.DomainServices.Server.DomainServiceDescription.AddQueryMethod (도메인 System.ServiceModel.DomainServices.Server.DomainServiceDescription에서 System.ServiceModel.DomainServices.Server.DomainServiceDescription.CreateDescription (유형 domainServiceType) 에서 System.ServiceModel.DomainServices.Server.DomainServiceDescription.Initialize() 에서 OperationEntry 방법) . System.ServiceModel.DomainServices에서 System.ServiceModel.DomainServices.Server.DomainServiceDescription.GetDescription (유형 domainServiceType) 에서 <> C_ DisplayClass8.b _7 (형 타입) System.Collections.Concurrent.ConcurrentDictionary 2.GetOrAdd(TKey key, Func
2 ValueFactory의 AT) D : \ Users \ carlucci \ Documents \ My Dropbox \ My Dropbox \ My2 \ PartialTrustTest \ PartialTrustTest의 PartialTrustTest.Program.Main (String [] args)에서 .Hosting.DomainServiceHost..ctor (유형 domainServiceType, Uri [] baseAddresses) \ Program.cs : System.AppDomain._nExecuteAssembly (RuntimeAssembly 어셈블리, String [] args)의 줄 System.AppDomain.nExecuteAssembly (RuntimeAssembly 어셈블리, String [] args)의 at System .Runtime.Hosting.ManifestRunner.Run (Boolean checkAptModel) at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() at System.Runtime.Hosting.ApplicationActivator.를 CreateInstance (ActivationContext activationContext 문자열 [] activationCustomData) Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone에서 System.Activator.CreateInstance (ActivationContext activationContext) 에서 System.Runtime.Hosting.ApplicationActivator.CreateInstance (ActivationContext activationContext) (AT ) System.Threading.ExecutionContext.Run에서 System.Threading.ExecutionContext.Run에서 System.Threading.ThreadHelper.ThreadStart_Context (개체 상태) (의 ExecutionContext의 ExecutionContext, ContextCallback 콜백 개체 상태, 부울 ignoreSyncCtx) (의 ExecutionContext의 ExecutionContext, ContextCallback 콜백에서, 개체 상태)at System.Threading.Th
readHelper.ThreadStart() 의 InnerException : 나는 APTCA에 System.ComponentModel.DataAnnotations를 추가하려고
,하지만 난 완전 신뢰에서 실행되도록 내 응용 프로그램을 변경없이 성공 :(
하지만, 성공 없음 :(
어떤 생각?
디버그 모드에서 실행하는 경우, 프로젝트 속성으로 이동해야>의 선택을 취소 "비주얼 스튜디오를 사용 호스팅 프로세스 "및이 오류가 중지됩니다. –