19

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 [HKLM\Software\Microsoft\Fusion!EnableLog].
    BusinessApplication2

10 Answers 10

32

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.

4
  • I also had the problem after a blue screen, and the fix worked for me too! Thanks for saving me some time. Jul 26, 2011 at 18:31
  • 6
    In my case the temporary files were in the following directory: C:\Users\myUserName\AppData\Local\Temp\Temporary ASP.NET Files Nov 8, 2011 at 16:15
  • In my case it was about 1) Blue screen 2) Error about CreateRiaClientFilesTask is referenced to Micrisift.Practices.Unity.Interception.dll But that solution is fantastic! Thank you!
    – NoWar
    Dec 17, 2013 at 11:08
  • Maybe the location changed but I had to delete in a subdirectory C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs along with running Visual Studio 2013 in admin mode.
    – ΩmegaMan
    Feb 2, 2015 at 17:32
4

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

2

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.

1

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

0

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.

1
  • I've found out that if you Build your project nor Rebuilding it, it will reduce the number times that error occur.
    – mrtaikandi
    Jan 13, 2011 at 14:16
0

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

1
0

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.

0

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.

0

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.

0

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.