Usuário com melhor resposta
Aplicação Silverlight não funciona no servidor

Pergunta
-
Bom dia pessoal!!
Estou com um problemão, tenho uma aplicação silverlight que está rodando normalmente em minha máquina local (Silverlight 4 + VS2010 + SQLServer 2008R2 + WCF Service), porém quando eu publico no servidor e tenho acessar de outra máquina dá um erro.
Já tentei colocar os arquivos clientaccesspolicy.xml e crossdomain.xml + não corrigiu o erro.CONFIGURAÇÃO MINHA MÁQUINA
Windows 7, VS2010, Silverlight 4, Silverlight Enabled WCF ServiceCONFIGURAÇÃO SERVIDOR
Windows Enterprise 2008 Server, IIS 7, .Net 4.0Erro que está dando no servidor.
Server Error in '/NomeAplicacao' Application. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Web.HttpServerUtility.set_ScriptTimeout(Int32 value) +30 System.ServiceModel.Activation.HostedHttpRequestAsyncResult..ctor(HttpApplication context, String aspNetRouteServiceVirtualPath, Boolean flowContext, Boolean ensureWFService, AsyncCallback callback, Object state) +538 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +137 System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +24 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Alguém poderia me dar uma luz?
Obrigado a todos,
quinta-feira, 5 de agosto de 2010 14:37
Respostas
-
Boa noite, Samuka
Bem, se você colocou o arquivo de segurança no root do Serviço. ok!
Então passa para a segunda etapa: O arquivo ServiceReferences.ClientConfig, está configurado corretamente?
Caso sim, passe para a terceira etapa:
da uma olhada no arquivo webconfig: Example:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" >
<baseAddressPrefixFilters>
<add prefix="Endereço"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
abraços
Flavia Moreira
- Editado Flavia Moreira sábado, 7 de agosto de 2010 01:42 Erro no comentario
- Marcado como Resposta Samuka Ferreira quinta-feira, 9 de setembro de 2010 20:40
sábado, 7 de agosto de 2010 01:41
Todas as Respostas
-
Boa noite, Samuka
Bem, se você colocou o arquivo de segurança no root do Serviço. ok!
Então passa para a segunda etapa: O arquivo ServiceReferences.ClientConfig, está configurado corretamente?
Caso sim, passe para a terceira etapa:
da uma olhada no arquivo webconfig: Example:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" >
<baseAddressPrefixFilters>
<add prefix="Endereço"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
abraços
Flavia Moreira
- Editado Flavia Moreira sábado, 7 de agosto de 2010 01:42 Erro no comentario
- Marcado como Resposta Samuka Ferreira quinta-feira, 9 de setembro de 2010 20:40
sábado, 7 de agosto de 2010 01:41 -
Olá Samuka!!!
Vejo que o seu problema é o meu problema tb. :(
Estou com esse mesmo problema há 1 semana, caso vc consiga resolver me avisa blz que eu farei o mesmo.
Abraço.
terça-feira, 24 de agosto de 2010 11:53 -
boa noite pessoal
sou novo por aqui
mas estou tendo o mesmo problema ou bem semelhante
Flávia e amigos
fiz uma aplicacao de testes com silverlight e uym wcf service no visual studio funciona belezinha
mas eu publiquei os arquivos e da erro ao acessar o wcf service no servidor
segue abaixo o erro e tambem meu arquivo web.config
agradeco a todos pela atencao
********erro no servidor ******
Detalhes dos erros da página da Web
Agente de Usuário: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET4.0C; .NET4.0E)
Carimbo de data/hora: Tue, 19 Oct 2010 02:55:08 UTC
Mensagem: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> System.ServiceModel.CommunicationException: An error occurred while trying to make a request to URI 'http://localhost:51067/Servicos.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details. ---> System.Security.SecurityException ---> System.Security.SecurityException: Security error.
em System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
em System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
em System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
--- Fim do rastreamento de pilha de exceções internas ---
em System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
em System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
em System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
--- Fim do rastreamento de pilha de exceções internas ---
em System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
em System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
em System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
em slNavApp.Servicos.ServicosClient.ServicosClientChannel.Endsvc_ret_0_OlaPessoal(IAsyncResult result)
em slNavApp.Servicos.ServicosClient.slNavApp.Servicos.Servicos.Endsvc_ret_0_OlaPessoal(IAsyncResult result)
em slNavApp.Servicos.ServicosClient.OnEndsvc_ret_0_OlaPessoal(IAsyncResult result)
em System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
--- Fim do rastreamento de pilha de exceções internas ---
em System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
em slNavApp.Servicos.svc_ret_0_OlaPessoalCompletedEventArgs.get_Result()
em slNavApp.About.cliente_OlaPessoalCompleto(Object sender, svc_ret_0_OlaPessoalCompletedEventArgs e)
em slNavApp.Servicos.ServicosClient.Onsvc_ret_0_OlaPessoalCompleted(Object state)
****************************
***** web.config****
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="slNavApp.Web.Servicos.customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<services>
<service name="slNavApp.Web.Servicos">
<endpoint address="" binding="customBinding" bindingConfiguration="slNavApp.Web.Servicos.customBinding0"
contract="slNavApp.Web.Servicos" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
</configuration>
*****************
terça-feira, 19 de outubro de 2010 02:56 -
Olá tive o mesmo ploblema e descobri que o servidor que hos pedava não aceitava silverlight 4, bom mudei de provedor, para um que tem silverlight 4, sql server 2008 r2 e framework 4. agora tudo funciona, quem precisar gustavol2004@hotmail.comdomingo, 24 de outubro de 2010 18:54