WCF service hosted in IIS throws 'Failed to access IIS metabase' error - wcf

Deployed a WCF service in IIS 6.0 gave NETWORK_sERVICE user read/write privileges.
When tries to brows to .SVC file i get below error
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
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:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +637
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +174
System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51
System.Web.CachedPathData.GetConfigPathData(String configPath) +341
System.Web.CachedPathData.GetConfigPathData(String configPath) +234
System.Web.CachedPathData.GetApplicationPathData() +38
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +8806383
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +117
Any thoughts?

Was told that we get 'Failed to access IIS metabase' error if we install IIS after intalling .NET Framework, and remedy is to re-install ASP.NET.
To resolve this error I have followed below steps
1. Stopped IIS
2. Ran below command in command prompt to re-install aspnet.
%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
Result:
Start installing ASP.NET (2.0.50727).
..................................................................
Finished installing ASP.NET (2.0.50727).
3. Re-started IIS and WCF service is responding without any issues.

Related

Example of a .Net6 Blazor WebAssembly application with authentication using local Sql Db?

I'm trying to add authentication (with registration, password reset etc) to a .Net6 Blazor WebAssembly project. When creating the project include authentication for individual accounts (to local sql db), configure for HTTPS, Asp.Net Core hosted and Progressive Web Application. This is done in VS 2022.
The problem I'm facing is that each project I've created so far continues to crash as soon as I try to register or login.
similar to this thread: Blazor WebAssembly Hosted Proxy crash on successful authentication
I also looked at the link to https://github.com/dotnet/aspnetcore/issues/26635 but the issue was resolved. I'm currently running Chrome Version 99.0.4844.82 (Official Build) (64-bit).
I tried removing the autocomplete attribute on the server side cshtml pages but the project still random crashes.
Has anyone successfully implemented authentication (using local Sql) in a webAssebly project with .Net6?
I also tried to run the samples from the .NetCore git repo and the apps continue to crash.
This is the server console output:
fail: Microsoft.WebAssembly.Diagnostics.DevToolsProxy[0] DevToolsProxy::Run: Exception System.AggregateException: One or more errors occurred. (The remote party closed the WebSocket connection without completing the close handshake.) ---> System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request. at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.g__ThrowSocketException|5_0(SocketError e) at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.GetResult(Int16 token) at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.DoReceive() at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result) at System.IO.Pipelines.Pipe.GetReadAsyncResult() at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1UpgradeMessageBody.ReadAsyncInternalAwaited(ValueTask1 readTask, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory1 destination, CancellationToken cancellationToken) at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Threading.Tasks.ValueTask`1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) --- End of stack trace from previous location --- at Microsoft.WebAssembly.Diagnostics.DevToolsProxy.ReadOne(WebSocket socket, CancellationToken token) --- End of inner exception stack trace --- at Microsoft.WebAssembly.Diagnostics.DevToolsProxy.Run(Uri browserUri, WebSocket ideSocket)
This is the VS output screen details:
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
The program '' has exited with code 4294967295 (0xffffffff).
Exception thrown: 'Microsoft.AspNetCore.Connections.ConnectionResetException' in System.Private.CoreLib.dll
Exception thrown: '' in Unknown Module.
The thread 0x1 has exited with code 0 (0x0).
The program 'service-worker.js' has exited with code 4294967295 (0xffffffff).
The program '[25288] Chatter.Server.exe' has exited with code 4294967295 (0xffffffff).
The thread 0x0 has exited with code 0 (0x0).
The program 'localhost:7151' has exited with code 4294967295 (0xffffffff).
Any advise will be greatly appreciated.
Thanx
Riaan
fail: Microsoft.WebAssembly.Diagnostics.DevToolsProxy[0]
DevToolsProxy::Run: Exception System.AggregateException: One or more
errors occurred. (The remote party closed the WebSocket connection
without completing the close handshake.)
To the above error, as far as I know, after update to VS 2022 17.1, it will show the websocket error. And, if check the console output, you will find the above error.
To solve the above error, you can try to use the VS 2022 17.2.0 Preview 2.0 version, this issue has been fixed in this version. Or you can try to install the earlier VS 2022 version, refer this link. I also check it using VS 2022 17.0.4 version, it doesn't have this error, you can try to use this version.
To the Local SQL Server error, I guess you are meeting the following error, right?
To solve the above error, you can use the following migration commands to generate the DataBase first (Or you can use the existing database), then the above error will disappear when you run the application.
add-migration generateDatabase
Update-Database
More detail information about migration, see Migrations Overview.

WCF Service hosted in Azure Cloud Service errors after published

I have a project with several WCF services (mix of REST and SOAP). The project has been running On-Prem for 6 months without an issue. We are moving this to Azure but have run into an issue that will prevent us from going live.
The project uses Autofac for it's IOC. We are gonig to host this in a Cloud Service in Azure. Everything appears to work correctly when running locally in the Azure Emulator however once we deploy using the Cloud Service project, everything builds and deploys correctly, but we receive the following error when trying to access a service.
Server Error in '/' Application.
Value cannot be null. Parameter name: key
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key 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:
[ArgumentNullException: Value cannot be null.
Parameter name: key]
System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +48
System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +38
System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +20
System.ServiceModel.Dispatcher.WebHttpDispatchOperationSelector..ctor(ServiceEndpoint endpoint) +2459
System.ServiceModel.Description.WebHttpBehavior.GetOperationSelector(ServiceEndpoint endpoint) +125
System.ServiceModel.Description.WebHttpBehavior.ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) +1955
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +4245
System.ServiceModel.ServiceHostBase.InitializeRuntime() +119
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +45
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +553
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +350
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1614
[ServiceActivationException: The service '/Event/Calendar' cannot be activated due to an exception during compilation. The exception message is: Value cannot be null.
Parameter name: key.]
System.Runtime.AsyncResult.End(IAsyncResult result) +925
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +528
System.ServiceModel.Activation.AspNetRouteServiceHttpHandler.EndProcessRequest(IAsyncResult result) +107
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +151
It appears that it's having an issue with the service configuration endpoint. That is registered through Autofac WCF integration using the OOTB RouteTable here:
RouteTable.Routes.Add(new ServiceRoute("Event/Calendar", new AutofacWebServiceHostFactory(), typeof(CalendarSvc)));
All of this works fine in IIS and the local Azure emulator, but once deployed to the cloud service is where we get an issue.
Observed exactly problem. Solved by canceling IntelliTrace on this hosted service.
I did publishing from VS2013 and marked "Enable IntelliTrace" during publishing. Once I canceled this option and re-publish - all works properly....

Exposing wcf service in BizTalk 2010

I have ran into this issue the past few weeks ago and I still can not figure out why.
I have a BizTalk orchestration that receives a BizTalk message, processes it and eventually writes it to a file. For simplicity sake, let say, our goal is to take the message (which is actually a survey) and save it to a folder as is. I have created a public receive port to catch the msg and a send port to write the result out to disk.
I have successfully deployed the project and have successfully published it to IIS. I was able to see the WCF service in IIS and have set it to use Framework 4.0. I have set up all the relevant receive and send ports and have started the application successfully from BizTalk management console. (The receive location was automatically created when I published the wcf service, the send location is a type FILE located in a folder in the computer)
From DefaultSite in IIS, I could see my WCF. However, when I tried http://localhost/TestSurvey/TestSurvey_Orchestration_1_getSurveyPort.svc,
I got the following error:
Server Error in '/TestSurvey' Application.
--------------------------------------------------------------------------------
Login failed for user 'Domain\ComputerName$'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'ACAD1\DENBIZDEV$'.
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:
[SqlException (0x80131904): Login failed for user 'Domain\ComputeName$'.]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
Microsoft.BizTalk.TransportProxy.Interop.IBTTransportProxy.RegisterIsolatedReceiver(String url, IBTTransportConfig callback) +0
Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfIsolatedReceiver`2.RegisterIsolatedReceiver(Uri uri) +1028
Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHostFactory`3.CreateServiceHost(String constructorString, Uri[] baseAddresses) +363
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172
[ServiceActivationException: The service '/TestSurvey/TestSurvey_Orchestration_1_getSurveyPort.svc' cannot be activated due to an exception during compilation. The exception message is: Exception has been thrown by the target of an invocation..]
System.Runtime.AsyncResult.End(IAsyncResult result) +901424
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178638
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
My question is: what is it that BizTalk was trying to login? Domain\ComputerName$ is definitely not a user. I have not tried to access any database from the orchestration. I believe my IIS was set up correctly as I have created a quick and dirty wcf service test from VS2010 and published it to my IIS, then have successfully created a simple client to consume the wcf service test. I did not encounter the same issue when I created the wcf service test directly.
Any help or hint is highly appreciated!
EDIT
I managed to fix this: it was not the web config as it was created by BizTalk. I had to create a special app pool and tied my application to using it. In the app pool I have to use the custom credential that BizTalk is using. Using the built in credentials caused the issue I experienced. My rookie error! Once BizTalk login credential was used, everything went smoothly.
The database which is throwing the SQL exception is one of the BizTalk databases, probably the management or SSO DB.
The error is almost certainly being caused by the setup of IIS, whether the app pool identity or the web site security settings.
What is hapenning is that when you call the service for the first time IIS is compiling your service, and to do this it obviously needs access to one of the BizTalk databases, but this call is not authenticated for some reason.
This could be because the app pool user must be a member of the BizTalk Isolated Host Users group (which may be called something different depending on how BizTalk was set up.

WCF - weird error

I have my dll hosted at IIS with wsHttpBinding. I have this weird error happened intermediate.
Well, everything will be restored back normal again when I reset the IIS (iisreset).
I also read this one http://msdn.microsoft.com/en-us/library/ee517280.aspx. But I am not sure it has to do with this. Please guide me if you more info on this. Thanks.
Server Error in '/MSBuildCompilation' Application.
Either a required impersonation level was not provided, or the
provided impersonation level is invalid. (Exception from HRESULT:
0x80070542) Description: An unhandled exception occurred during the
execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.Runtime.InteropServices.COMException: Either
a required impersonation level was not provided, or the provided
impersonation level is invalid. (Exception from HRESULT: 0x80070542)
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:
[COMException (0x80070542): Either a required impersonation level was
not provided, or the provided impersonation level is invalid.
(Exception from HRESULT: 0x80070542)]
[FileLoadException: Could not load file or assembly
'System.ServiceModel, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. Either a
required impersonation level was not provided, or the provided
impersonation level is invalid. (Exception from HRESULT: 0x80070542)]
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object
sender, EventArgs e) +0
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+148 System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +75
Looks like you are trying to run the .NET 4.0 Framework in IIS6 which be tricky according to this post. Haven't tried that myself. The exception you are getting is actually happening because your process is unsuccessfully trying to load the System.ServiceModel version 4.0 DLL. Although that post is for ASP.NET, it's applicable to WCF because ASP.NET is the service host process in IIS6. Here is another question along the same lines with some good answers.
(Answered by original poster but in wrong place, moved by me.)
Hi all, I finally solved my own problem by adding this 2 lines at my Client Application code:
WindowsClientCredential wsCred = wsFactory.Credentials.Windows;
wsCred.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
This 2 lines to force client to impersonate every time when it connects.

IIS7 + WCF + Silverlight problems

I've been building a silverlight application and a WCF service for a while now and recently tried to host them in IIS7.
I installed IIS7 on Windows Server 2008 R2 and added these two application to my default website. I am having a number of problems so im hoping one of you can help out...
1) The silverlight and WCF service applications do not work with pass-through authentication. I need to "connect as" the administrator server account when setting up the application. I read online that you should only need to use the "connect as" field when you are connecting to another computer. If i dont supply the admin credentials i get this error. Do i have to set up permissions somewhere else?
HTTP Error 500.19 - Internal Server Error The requested page cannot be
accessed because the related configuration data for the page is
invalid. Detailed Error Information Module IIS Web Core Notification
BeginRequest Handler Not yet determined Error Code 0x80070005 Config
Error Cannot read configuration file due to insufficient permissions
Config File \?\C:\Users\Administrator\Documents\My Dropbox\Research
Masters\Project\WCFService\Website\web.config Requested URL
http:://localhost:80/WCFService/Service.svc Physical Path
C:\Users\Administrator\Documents\My Dropbox\Research
Masters\Project\WCFService\Website\Service.svc Logon Method Not yet
determined Logon User Not yet determined Config Source -1:
0: Links and More Information This error occurs when there is a
problem reading the configuration file for the Web server or Web
application. In some cases, the event logs may contain more
information about what caused this error.
2) Visual studio generated 2 webpages to run my silverlight application (.html and .aspx). When I am running the silverlight application (connected as admin) I can navigate to the .html page, no problem. When I try to open the .aspx file i get the following error
Server Error in '/Platform' Application.
Access is denied.
Description: An error occurred while accessing the resources required
to serve this request. You might not have permission to view the
requested resources.
Error message 401.3: You do not have permission to view this directory
or page using the credentials you supplied (access denied due to
Access Control Lists). Ask the Web server's administrator to give you
access to 'C:\Users\Administrator\Documents\My Dropbox\Research
Masters\Project\Platform\Website\PlatformTestPage.aspx'.
Version Information: Microsoft .NET Framework Version:4.0.30128;
ASP.NET Version:4.0.30128.1
3) The WCF service runs fine (again, connected as admin) until i restart the server. When i try to run the WCF service after a reboot, the mysql assembly seems to be missing from the solution. If i just rebuilt the solution and run the service again... it works (until next restart). Whats causing this error?
Solution here - http://tinypic.com/view.php?pic=5yasqx&s=5
Server Error in '/WCFService' Application.
Could not load file or assembly 'MySql.Data, Version=6.2.2.0,
Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its
dependencies. Access is denied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'MySql.Data, Version=6.2.2.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d' or one of its dependencies. Access is
denied.
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.
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'MySql.Data, Version=6.2.2.0,
Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded.
WRN: Assembly binding logging is turned OFF. To enable assembly bind
failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileLoadException: Could not load file or assembly 'MySql.Data,
Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or
one of its dependencies. Access is denied.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark,
Boolean forIntrospection, Boolean suppressSecurityChecks) +567
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +192 System.Reflection.Assembly.Load(String
assemblyString) +35
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String
constructorString, Uri[] baseAddresses) +243
System.ServiceModel.HostingManager.CreateService(String
normalizedVirtualPath) +1423
System.ServiceModel.HostingManager.ActivateService(String
normalizedVirtualPath) +50
System.ServiceModel.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath) +1132
[ServiceActivationException: The service '/WCFService/Service.svc'
cannot be activated due to an exception during compilation. The
exception message is: Could not load file or assembly 'MySql.Data,
Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or
one of its dependencies. Access is denied..]
System.Runtime.AsyncResult.End(IAsyncResult result) +889824
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult
result) +179150
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult
ar) +107
Version Information: Microsoft .NET Framework Version:4.0.30128;
ASP.NET Version:4.0.30128.1
Thats about it, hope someone reads this message, I wasted most of the weekend trying to fix these problems on my own... thanks
My suggestions:
1) Check your web application folder's permissions. You should edit the permissions on your web application folder so that the IIS user can read from the folder.
So you should open the folder properties dialog for the folder in the windows explorer and check if the application pool user has at least read permissions. If you didn't provide another user for the application pool, then the default user should be IIS_IUSRS.
2) Check if the asp.net is enabled in your system by running:
If you have .Net 4 installed in your system:
"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe" –i
Otherwise:
"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe" –i
The above command will register/repair the your .Net installation with the IIS.
3) Is your mysql dll locate in the bin folder? I would check if you also have permissions to read this folder. If the dll is not in the same folder as your application dll, check if the dll is installed in the GAC.
Regards,
1)Give permissions to the folder for the IIS_IUSRS group.
Also see if the application pool for the application in IIS manager->"Application Pools" has the Identity set as "LocalSystem". For me it was "NetworkService", setting it to "LocalSystem" solved it.
You must not be able to host silverlight applications with IIS7.
Try hosting your silverlight app on an apache server with a php / html script.
Hope that helps mate
Please rate my answer
Anzwerx