This error has started occuring when attempting to build my VS 2010 Silverlight project after some minor changes to my RIA domain services, which are hosted within the Silverlight website application. There appears to be no reason for this error and I cannot understand the access denied part of the error.
Things I have tried:
1) Full clean of all projects in the solution and re-build 2) Deletion of all temporary ASP.Net files from the framework folder 3) Removal of linked RIA services from project properties from the class library that is failing, clean, re-build and then re-add linked RIA services
Any advice on where to go from here would be much appreciated:
Error 21 The "CreateRiaClientFilesTask" task failed unexpectedly. System.Web.HttpException (0x80004005): Could not load file or assembly 'Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. ---> System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'Business' or one of its dependencies. Access is denied.
--- End of inner exception stack trace --- at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) --- End of inner exception stack trace --- at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() at System.Web.Compilation.BuildManager.CallPreStartInitMethods() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) at System.Web.Compilation.ClientBuildManager.EnsureHostCreated() at System.Web.Compilation.ClientBuildManager.CreateObject(Type type, Boolean failIfExists) at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.CreateSharedTypeService(ClientBuildManager clientBuildManager, IEnumerable`1 serverAssemblies, ILogger logger) at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.GenerateClientProxies() at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal() at Microsoft.ServiceModel.DomainServices.Tools.RiaClientFilesTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) Insurer.Analytics.Common
Just had the same problem - turns out that something changed the permissions on the "Temporary ASP.NET Files" folder. It's easy to test. Click the ASP.Net Configuration in solution explorer for the .web project. It'll likely throw an access denied error and point you to the temp asp.net files folder. If so, open web.config in your .web project and add a tempDirectory directive to compilation, like so:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" tempDirectory="C:\<SomeDirectoryYouFullyControl>\Temporary ASP.Net Files" />
</system.web>
Rebuild your .web project and update your service reference in your silverlight project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With