开发者

The "CreateRiaClientFilesTask" task failed unexpectedly

I've VS 2010 and recently installed WCF RIA Services V1.0. For testing I have created a new Silverligh Business project but now every now and then when I rebuild the solution I receive the following error:

Does anybody know why I get this?

Thanks

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 [H开发者_如何学编程KLM\Software\Microsoft\Fusion!EnableLog].
    BusinessApplication2


Close VS, delete files in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\. Restart VS, Build solution. By the way; I got the problem after a bluescreen.


I found restarting VS in Administrator mode was all that was required.


Try to remove the DomainServices Assemblies (... References), then run "Clean" on the Project or better the whole Solution. Restart VS and add the Assemblies anew.


My solution was to remove the app settings from the config file.


I use VS 2010 and Windows 7. I've got this exception and after reopen solution it repeated again. The next helped in my case. I've closed VS and open solution again, but not running .sln file - I run VS from shortcut with administrator rights (not sure that admin rights really need) and select my solution on start page of Visual Studio. After that I rebuilt solution.


After installing WCF RIA V1.0 SP1 problem just disappear.


I had this problem for months and months on my new work computer, after getting frustrated with my antivirus slowing my machine down (McAfee not my choice was installed by admin) I removed it and voila, I stop getting the CreateRiaClientFilesTask error. It seems there are a million different reasons for this happening but this has definitely worked for me, I'm now just using the bog standard Microsoft Antivirus that's not installed on Windows but can be found if you follow your nose in the Windows 7 security section where it says No Antivirus Installed.


I experianced the same problem with McAfee as Rob, but instead of remove it, I just turned off the "Real-Time Scanning" under the Virus and Spyware Protection and Firewall under Web and Email Protection. This setting was temporary only during build the project.


I was getting this error on my TFS build server, but not on my development machine.

It turned out to be because my development box had the MS14-059 security update (the update that broke builds), and I had fixed it on my build machine by updating my projects to use the Microsoft.AspNet.Mvc NuGet package, instead of referencing the 3.0.0.0 assembly from the GAC. The build server, on the other hand, did not have MS14-059 installed. So my projects referenced System.Web.Mvc version 3.0.0.1, but the build server only had 3.0.0.0 in its GAC.

I ran gacutil -l | find /i "mvc" to verify that my development machine had System.Web.Mvc 3.0.0.1 in its GAC, and the build server only had 3.0.0.0.

When I upgraded to the NuGet package, it added binding redirects to my web.config, so the project probably would have run just fine on the build server. But RIA Services' msbuild task, which ran at build time and didn't care about the binding redirects in web.config, didn't fare so well with the version mismatch.

The fix was to install MS14-059 on the build machine.


This happened to me when upgrading from MVC3 to MVC5. MVC5 lists dependent assemblies in a different place in web.config. Look for an <assemblies> section in web.config and comment it out (even though it is the correct version)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜