我试过的事情
1)彻底清理解决方案中的所有项目并重新构建
2)从框架文件夹中删除所有临时ASP.Net文件
3)从类库中的项目属性中删除链接的RIA服务,该类库失败,清理,重新构建,然后重新添加链接的RIA服务
任何关于从这里去哪里的建议将非常感谢:
错误21“CreateRiaClientFilesTask”任务意外失败.
System.Web.HttpException(0x80004005):无法加载文件或程序集“Business,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null”或其一个依赖项.访问被拒绝. —> System.Configuration.ConfigurationErrorsException:无法加载文件或程序集“Business,PublicKeyToken = null”或其一个依赖项.访问被拒绝. —> System.IO.FileLoadException:无法加载文件或程序集“Business,PublicKeyToken = null”或其一个依赖项.访问被拒绝. —> System.IO.FileLoadException:无法加载文件或程序集“Business”或其一个依赖项.访问被拒绝.
—内部异常堆栈跟踪结束—
在System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks)
在System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,Boolean suppressSecurityChecks)
在System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,Boolean suppressSecurityChecks)
在System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,Boolean forIntrospection)
在System.Reflection.Assembly.Load(String assemblyString)
在System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)
—内部异常堆栈跟踪结束—
在System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)
在System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
在System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
在System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
在System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
在System.Web.Compilation.BuildManager.CallPreStartInitMethods()
在System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException)
在System.Web.Compilation.ClientBuildManager.EnsureHostCreated()
在System.Web.Compilation.ClientBuildManager.CreateObject(Type type,Boolean failIfExists)
在Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.CreateSharedTypeService(ClientBuildManager clientBuildManager,IEnumerable`1 serverAssemblies,ILogger logger)
在Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.GenerateClientProxies()
在Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal()
在Microsoft.ServiceModel.DomainServices.Tools.RiaClientFilesTask.Execute()
在Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
在Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost,TaskLoggingContext taskLoggingContext,TaskHost taskHost,ItemBucket bucket,TaskExecutionMode howToExecuteTask,Boolean& taskResult)Insurer.Analytics.Common
解决方法
<configuration> <system.web> <compilation debug="true" targetFramework="4.0" tempDirectory="C:\<SomeDirectoryYouFullyControl>\Temporary ASP.Net Files" /> </system.web>
重建您的.web项目,并更新您的Silverlight项目中的服务参考.