“CreateRiaClientFilesTask” task failed unexpectedly

匿名 (未验证) 提交于 2019-12-03 03:06:01

问题:

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

回答1:

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.



回答2:

In my case Debug build was working, but Release wasn't.

Actual problem was that for highlighted problem-project it had x64 in Mixed Platforms Platform instead of Any CPU

I spent like 2.5 hours on this so hope it helps to someone



回答3:

I had a similar issue. My web app had an issue with the OutputPath. I fixed it by going to the project Properties -> Build -> OutputPath and changing the OutputPath of my project from "bin\Debug\" back to the default "bin\".



回答4:

Open your bin folder and delete anything that is left inside.Rebuild your project -- that's what worked for me.My build configs were all set to Debug ,any CPU.



回答5:

I had this error, tried many solutions and dind't seem to get fixed, until I manually erased all files from my local mapping folder and downloaded them again, restarted the computer and finally compiled!



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!