2010-05-24 76 views
19

我已经VS 2010和最近安装的WCF RIA Services V1.0。对于测试,我创建了一个新的Silverligh业务项目,但现在每当我重建解决方案时,我收到以下错误:“CreateRiaClientFilesTask”任务意外失败

有人知道我为什么得到这个吗?

感谢

Error 1 The "CreateRiaClientFilesTask" task failed unexpectedly. 
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ServiceModel.DomainServices.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 
File name: 'Microsoft.ServiceModel.DomainServices.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 
    at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) 
    at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) 
    at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) 
    at System.Type.GetType(String typeName, Boolean throwOnError) 
    at System.Web.Hosting.HostingEnvironment.CreateWellKnownObjectInstance(String assemblyQualifiedName, Boolean failIfExists) 
    at System.Web.Hosting.HostingEnvironment.CreateWellKnownObjectInstance(String assemblyQualifiedName, Boolean failIfExists) 
    at System.Web.Hosting.ApplicationManager.CreateObjectInternal(String appId, Type type, IApplicationHost appHost, Boolean failIfExists, HostingEnvironmentParameters hostingParameters) 
    at System.Web.Hosting.ApplicationManager.CreateObjectInternal(String appId, Type type, IApplicationHost appHost, Boolean failIfExists) 
    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) 

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]. 
    BusinessApplication2 

回答

2

尝试删除DomainServices大会(...参考资料),然后在项目或更好的整体解决方案运行“干净”。重新启动VS并重新添加组件。

0

我使用VS 2010和Windows 7.我有这个异常,并在重新打开解决方案后,它再次重复。下一个在我的情况帮助。我已经关闭VS并再次打开解决方案,但没有运行.sln文件 - 我使用管理员权限(不确定管理员权限真正需要)从快捷方式运行VS,并在Visual Studio的开始页面上选择我的解决方案。之后,我重建了解决方案。

+0

我发现如果您构建您的项目或重建它,它将减少发生错误的次数。 – mrtaikandi 2011-01-13 14:16:26

32

关闭VS,删除c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\中的文件。 重新启动VS,构建解决方案。顺便说一下;蓝屏后我遇到了问题。

+1

这为我工作。谢谢! – 2011-06-13 21:12:12

+0

我在蓝屏后也遇到了问题,修复工作也适用于我!谢谢你为我节省了一些时间。 – 2011-07-26 18:31:21

+6

在我的情况下,临时文件位于以下目录:C:\ Users \ myUserName \ AppData \ Local \ Temp \ Temporary ASP.NET Files – Entrodus 2011-11-08 16:15:04

1

我的解决方案是从配置文件中删除应用程序设置。

4

我发现在管理员模式下重新启动VS是所有需要的。

0

安装WCF RIA V1.0 SP1后问题就消失了。

+0

我们的团队使用SP2并且遇到了这个问题。 Øyvind的解决方案为我们工作。 http://stackoverflow.com/a/5296910/81595 – 2012-05-15 08:13:24

0

我有这个问题,我的新工作电脑上几个月的时间,我的杀毒放慢我的机器停机(迈克菲不是我的选择是由admin安装)我删除它,瞧,我停下来获得CreateRiaClientFilesTask错误感到沮丧之后。这似乎有一百万种不同的原因发生,但这对我来说确实有效,我现在只是使用未安装在Windows上的bog标准Microsoft Antivirus,但如果您在Windows 7安全部分中遵循自己的观点,可以找到它它说没有安装杀毒软件。

0

我对McAfee和Rob进行了同样的尝试,但不是将其删除,而是关闭了Web和电子邮件保护下的病毒和间谍软件防护和防火墙下的“实时扫描”。此设置仅在构建项目期间是临时的。

0

我在我的TFS构建服务器上得到了这个错误,但在我的开发机器上没有。

原来是因为我的开发有MS14-059安全更新(更新即broke builds),和我通过更新我的项目使用Microsoft.AspNet.Mvc NuGet包修好了我的构建机器上,而不是从GAC引用3.0.0.0程序集。另一方面,构建服务器没有安装MS14-059。所以我的项目引用System.Web.Mvc版本3.0.0.1,但构建服务器在其GAC中只有3.0.0.0。

我跑gacutil -l | find /i "mvc"来验证我的开发机器在其GAC中有System.Web.Mvc 3.0.0.1,而构建服务器只有3.0.0.0。

当我升级到NuGet包,它增加了绑定重定向到我的web.config,所以该项目将可能有运行在构建服务器就好了。但是RIA Services的msbuild任务在构建时运行,并且不关心web中的绑定重定向。配置,与版本不匹配的表现不佳。

该修复程序是在构建机器上的install MS14-059

0

从MVC3升级到MVC5时发生在我身上。 MVC5在web.config中的不同位置列出了相关的程序集。在web.config中找到<assemblies>部分并将其注释掉(尽管它是正确的版本)

相关问题