none
Unknown problem

    Question

  • Dear Admin,

     

    I am getting this problem while building a solution. I am not able to find any solution for this problem. 

     

    Error    3          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].

                SuperTrader.ClientControls

     

    Friday, April 23, 2010 4:14 AM

All replies

  • I am getting the same error message.

    I am going through the new Silverlight 4 training series on Channel 9. I am running Visual Studio 2010 Premium (RTM).

    To reproduce:
    1) Launch VS2010 RTM
    2) Click "File"-"New Project"
    3) Select "Silverlight"-"Silverlight Business Application", name application click [Ok]
    4) Right-click new Solution and choose Build.

    Gives error:

    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].
    	SlEventManager
    Sunday, April 25, 2010 5:06 PM
  • When you create a new project did you click "Enable WCF RIA Services"?  If so, uncheck it.

    Also, if you need WCF RIA Services...you need to uninstall the previous version(s) from your machine.  Unlike, when you can have a SL 2, 3 and 4 dev environment in a single machine...you can ONLY have a single WCF RIA Services environment.  It needs to be the current release, which is RC2.

    Sunday, April 25, 2010 7:18 PM
  • Thanks for the suggestions.

    When creating an app with the "Silverlight Business Application" template, the application wires up the WCF RIA Services automatically (no options to be unchecked for this in the File->New Project dialog). I also have the latest RC bits for WCF RIA Services.

    I did find my problem however... I have Telerik's JustCode installed for VS2010 (RTM) and this was causing a problem with the code being generated that caused the solution builds to fail.

    I've disabled the JustCode add-in, restarted VS2010 and it is now working correctly. I'm going to open a support ticket with Telerik.

    Thanks again for your help.

    Monday, April 26, 2010 8:10 PM
  • I am having the same problem, my project worked fine before upgrading to silverlight 4 and the newest RIA services tools.  I removed the tools and re-installed them a couple times but I get the same messages, I attempted to rebuild the Domain Service page from scratch incase something was corrupt, I get no errors in the project until I tell it to rebuild all(or clean and rebuild) then the first error that appears is the one listed above.  This is very anoying to have something working great in an older version to upgrade and then nothing work.  Any info on how to resolve this would be helpful. 

    Also I have no add ons in VS 2010 at all that might be causing this problem, install was done from top to bottom of the getting started page as specified.(I do still have VS2008 and Silverlight 3 installed, RIA Services toolkit and RIA Services V1.0 for Visual Studio 2010 were uninstalled and installed from downloaded files today)

     Thanks

    Thursday, April 29, 2010 12:05 PM
  • Could I ask for more information?  This sounds related to the upgrade to SL4 and WCF RIA Services.  This upgrade does not automatically upgrade existing SL projects so this is where I would start looking.  This build task is triggered when an SL project builds and has the "WCF RIA Service link" set.   So even though you create a DomainService from scratch, it is really the SL projects where you should be looking.  Could you attach one?  I'm specifically interested in knowing about the <TargetFrameworkVersion> in your SL's .csproj and the "Import Project" statement near the end of the same file.  It sounds like it is targetting SL 3 when it should be:

           <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

     The WCF RIA Service feature works only with SL 4.

     

    Friday, April 30, 2010 11:51 AM
  • I have upgraded my whole project to silverlight 4 and web applicaiton to .NET 4.0 and I am recieving this message.

    Friday, April 30, 2010 12:03 PM
  • Something is broken and I'm trying to determine what it is.  I would like to know what "I have upgraded" actually did to the project files.

    Do you see this behavior if you create from scratch File | New Project | Silverlight | Silverlight Application?  Or is it exclusively with upgraded projects?

    Friday, April 30, 2010 12:25 PM
  • If I create a new Silverlight Project and assign it a new website it works, if I create a new web site and attempt to add a silverlight project to it(in the properties page) and enable WCF RIA Services, I get the error. 

    Friday, April 30, 2010 3:07 PM
  • in fact I can create a new silverlight Applicaiton using RIA on an exisiting web applicaiton that compiles fine without the app, as soon as I add the silverlight app and link RIA I get the error every time.

    I recall there being an odd bug when installing VS2010 to a drive other than C that you had to copy over the RIA Services files to the Installed Directory, which on mine is drive D.  Dont know if that helps at all.

    Friday, April 30, 2010 3:17 PM
  • I believe I have found the answer to my problem, the project is running on a network drive, drive P in my case, I have added the share to be a trusted share so VS2008 was happy, and also added the .NET 4 ignore remote location flag.  If I move the entire project to my local computer, all is well.  This is not an acceptable fix though, my company holds all of our code on a network drive that is mirrored and backed up every night.  Any one else having the same issue?

    Friday, April 30, 2010 3:39 PM
  • More info on this subject, I have found if I reference a DLL thats on the network share I get the error, if I remove the referernce, it goes away.

    Friday, April 30, 2010 4:29 PM
  • I am getting a strange type of problem. First i create a new Silverlight 4 Business Application project. Then if i run the Application it runs perfectly. If i compile the Silverlight Project then i get the following Error :

    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.

    I am really sick of this problem , still i am not getting any solution of this problem.I don;t know what really is wrong with this problem.

    Tuesday, May 04, 2010 8:36 AM
  • I also would like to get to the heart of this problem.  I believe you are seeing it, but most are not, so we need to discover how your situation is different.

    Can you describe your installation such as where Dev10 is installed, whether VS2008 is also installed, did you have earlier CTP versions of WCF RIA Services, etc?  Are you using VB?  C#?  How did you ask VS to configure when you first started it?

    Also, if you are able to uninstall WCF RIA Services, could you verify the Business Application Template is really gone?  It's possible you have an older template that did not get uninstalled.

    The fact the application you build runs but then fails on its build doesn't make sense to me.  Running the app obviously did a successful build, so having the 2nd build fail seems very strange.

    Also, do you share the experience of other users on this thread -- that this error happens on brand new projects as soon as you check the "WCF RIA Services Link?"   Or is it always related to existing apps or to the Business Application app?

    You might also try this from the CMD window to remove VS from the loop.  To do this:

    1. Open a VS CMD Prompt window (from the Start menu)

    2. cd to the folder containing your .sln file

    3. Run the command 'msbuild /t:clean xxx.sln'    (where xxx is the name of your sln file)

    4. Run the command 'msbuild /filelogger xxx.sln'

    The file msbuild.log created in that folder contains the output you would normally see in VS's Output window and Error List.

    Tuesday, May 04, 2010 8:58 AM
  • I have solved my problem, here is what I did, its not pretty but it worked.

    First I re-built my web application on my local drive(created a new web app, and imported all my pages)
    Then I imported my existing silverlight apps(3 of them) into the project
    Next I verrified that all my custom dlls were all the same compile type(x86 in my case)
    and to finish it off I added a new domain service page exposing the oData, after the file was created I deleted it(just used it to add all the dlls I needed)

    then mine worked fine.

    Things to note in my situation, if I had a custom DLL I made that was compiled for "Any CPU" and my main program was compiled for x86, I got the error

    If I attempted to load up the web app from a network location and attempt to compile the solution, I got the error.

    I attempted to just use my existing web app, but even moving it to my local drive didnt seem to help, I tried everything I could think of, something must have been saved in the vbproj or sln file that angered the RIA Gods...

    I do have VS 2008 installed as well, my vs2010 is installed ot my D: not C:, I removed the older RIA services before installing the new versions, my projects are all in vb, and I selected general development when asked. 

    In closing, RIA sucks... my service reference Silverlight apps I had to do nothing, it all worked great from start to finish... food for thought.  Hoep this information helps.

    Tuesday, May 04, 2010 9:43 AM
  • Sorry your experience was not better, and we appreciate the feedback.

    In the future, understanding all the non-standard choices you made will help us find a solution earlier.  Your choices are (or should be) valid, but knowing them in advance helps us focus on those areas.   If I understand correctly, you believe there are issues with:

         1. Mixed compile types in the Web project linked to from a SL project with a RIA Link

         2. Assembly references on shares when a RIA Link is involved.

    At the moment, you don't suspect installing VS2010 on D: was an issue.  Similarly, the presence of VS2008 does not appear to be an issue.

    Tuesday, May 04, 2010 10:08 AM
  • I am having the same problem:

    CreateRiaClientFilesTask" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ServiceModel.DomainServices.Tools, Version=4.0.0.0 

    and have done a clean build and un-installed and re-installed the two kits for RIA Services.

    I notice there are several other posts with this same problem. Is there any more suggestions than simply re-installing?

    For example, it seems that the tool that builds the Ria client classes is either not there or not finding a dependency. So where is this tool, and can I run it stand-alone to see what it wants? Is MS working on a fix?

    Thanks.

    Wednesday, May 26, 2010 1:16 PM
  • I'm afraid we can't provide a fix until we know the problem.   It would be an enormous help if people encountering this issue describe *precisely* what steps they used to get there.   It sounds like upgrading to SL4 is a theme for all of these (other than the one where a network drive was used).

    Has anyone experienced this bug on a brand new RIA Services app created from scratch?   Other than the one above about using a network drive?

    If it is an issue affecting only pre-SL4 projects being linked into a web project, you should be able to diff them against an SL4-created project and see what is different.   I would suspect an improper version for the TargetFrameworkVersion, or importing from the pre-SL4 set of Silverlight targets.

    If it involves new apps, then we must focus on what else is on that machine or what non-standard choices were made (e.g. use of network drive, installing VS to a different drive, some VS extensions not part of the normal RTM, etc.).  I'd also suspect older RIA Service installs.

    Key to us fixing this bug is getting a precise set of repro steps, so any more details you can provide would be especially appreciated.

    Wednesday, May 26, 2010 2:01 PM
  •  I have the same situation too.

    Microsoft.ServiceModel.DomainServices.Tools not found exception while building the project.

    Wednesday, May 26, 2010 5:58 PM
  • foreach (Post p in Posts.Where( pp => string.IsNullOrEmpty(pp.ReproSteps)) {

         p.Reply("Please send your repro steps", RespectLevel.High);

    }

    I really appreciate everyone taking time to report the issue, and I want to help.  But I need those steps.   I need to know what came before you saw this exception and whether you were upgrading from a prior version of Silverlight or RIA Services.  What you report does not happen in the "standard" case, and we're looking for what leads up to it or what makes the environment unique.

    Wednesday, May 26, 2010 6:25 PM
  • yes, this happens to me on a brand new app, created fresh from the new Ria Services using VS2010. I.e., there was no upgrade, and I believe I am using nothing but released versions.

    I am using Vista, but I currently trying to repro this problem on a Windows7 box as well.

    I installed VS 2010, then installed:

    Silverlight4_Tools.exe, RiaServices.msi, and RiaServicesToolkit.msi

    I have tried uninstalling and re-installing, but I still get the same error message.

    Here is one strange thing, and it may just be a coincidence. It appeared to work until I downloaded and ran a Sample application from the Silverlight Learn videos. Does this sound likely?

     I'll be happy to work with you (or anyone) to solve this. I really like the RIA concept, and the BusinessApplication pattern is exactly what I want to start with.

    Tell me what info you need and I'll get right on it. I have a dependency checker, so would it help to run it against the CreateRiaClientFilesTask and see if all the dependencies are correct?

     Let me know,

    Thanks.

    Thursday, May 27, 2010 12:34 AM
  •  Hi

    I use the VS2010 Express edition but I can confirm the rest of the story of batpox. 32Bit computer Vista. All permissions are set to me (Administrator). Installation as default recommended. BUT when I take the exact same project to my other Win7 computer with the same VS2010 (QuadCore CPU engine and some more RAM) there is no fault. In most cases I can Re-Build the project 3 times and then it works. Perhaps a problem of memory? This Computer has 2GB memory and VS2010 is using about 200MB of them as the Taskmanager says.

    I checked with dependencies and I think it will not help in my case.

    Idea:
    Today I found an file (I dont know more the filename because I delted it) who comes perhaps from copying the project from computer A to B. This file was unusual for such a project as I feel. The file was not included in the solution normally just when enabling the "hidden" button in the solution explorer. Today I will start the project again and see if it is better now. I miss a "cleaning" function  Cool

    Thursday, May 27, 2010 4:22 AM
  • Excellent -- thanks.  I'll work with our testers to focus on 32-bit Vista.

    There are 3 intriguing hunches above I'd like to explore at the same time.  I trust the gut .  They may be unrelated, but they might also be important clues.

    One was the Silverlight tutorial installation.  Do you recall which one?  If you do, we'll try it here.

    The 2nd is the rebuild-3-times scenario.  Can others confirm that this problem is sporadic, or is it absolute and completely blocking once it starts?

    The 3rd is the project copy.  I'm curious if you can duplicate that.   You should be able to do a solution level "Clean" before copying or zipping up a project and leave behind most of those hidden files.

    I'm interested in pursuring the memory angle if there is any hint of intermittent behavior.  How much memory do you have, and what does memory consumption look like (say with Task Manager) when you are building the solution in VS?

    Here is how I would like to proceed.  First let's remove VS from the equation by using only the CMD line.  It's described above, but to recap you would close VS, open a VS CMD prompt (in the Start Menu), cd to the folder containing the .sln file and run "msbuild YourSolution.sln /filelogger".  This will build the solution and produce an msbuild.log file with the output (also echoed to the Console).   If you see the error in this process, then it is completely independent of VS and worth reporting back.  If you don't see the error, proceed to the next step, which is:

    Open this SLN in VS, close all editor windows so you have nothing onscreen but the Solution Explorer (or even no windows at all).  Close and open VS, open this SLN, but avoid opening any windows.  Ask to do a solution level "Clean" and then a solution level "Build".  Do you see the error?

    By taking VS out of the picture, we remove the memory load as well as background processes like Intellisense.  By bringing back VS with empty windows, we place more memory pressure, but still minimize the background Intellisense overhead.

    The final (so far) step if things are still failing is to make sure the loader can really locate that file it is complaining about.  You can do this by adding a reference to Microsoft.ServiceModel.DomainServices.Tools to the .Web project (mine is installed in C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Server but your mileage may vary).  This should give you a reference with Copy Local = true so that that this tools assembly is available locally when the solution is built.  You normally would not do this, but it will yield information that may be useful if the above steps fail.

    Finally, what is the environment variable %ProgramFiles% on your machines?   You should see this in the VS CMD prompt just by typing "set".

    Thanks very much for hanging in there.

    Thursday, May 27, 2010 8:21 AM
  •  I've made several changes. Never had this fault again today. Yesterday I had it always. But I can not say exactly if it is solved or what it solved.

    ProgramData=C:\ProgramData
    ProgramFiles=D:\Program files

    I used also an recovery point because Windows Vista updated since some days and I just got the error after these updates. Perhaps by hazard. My current laptop has 2GB RAM. 2 HDD's Vista ultimate. Windows is installed on C:\, programs are installed on D:\.

    Dont cosh me but as I remember correctly, the file in the solution I deleted was something like App.xaml.g.vb. But never heard something about this file name or similar.

    Thursday, May 27, 2010 8:54 AM
  • I'm in the middle of following your list, but I thought I'd get this info back to you as I progress:

    I am on Vista 32 bit, and my memory shows 2.04GB used out of a total of 3061 MB (from Task manager).

    I ran the MSBUILD, and it reports no warnings or errors, and generates the hidden file <myproject>.web.g.cs for the client-side files successfully. (that's quite an interesting log file that it generates).

    So, I went back into VS, and I get the same error.

    The tutorial that I downloaded and ran was the Silverlight 4 Schedule Planner tutorial, and specifically the completed source from Exercise 4 of SL3LOB_05_Schedule_Planner. (Again, I'm not sure if this was just a coincidence).

    Concerning previous versions: I did not have any betas, but I could not swear that I didn't have any release candidates. I was good about following instructions for de-installing previous versions, though.

    Hope this helps. I'm continuing on your list...

     

    Thursday, May 27, 2010 9:26 AM
  • Sorry, I have to backtrack a bit.

     The MSBUILD also fails if I make an edit to the DomainService file (e.g. <myproj>DomainServices.cs in the Web project. I guess that 'CreateRia...' task only runs if it detects a change to the server-side file.

    Would the msbuild generated log help you?

    Thursday, May 27, 2010 9:36 AM
  • Yes, I forgot to mention the code generator leaves breadcrumbs behind and does no work if it finds there is nothing new.

    Did you try the final step of adding a reference to the Tools assembly?  I'm curious if that helps.

    I don't need to see the msbuild.log unless the section around "CreateRiaClientFiles" is substantially different from the stack traces earlier on this thread.  I am guessing we have the same load failure of the Tools assembly (which is why the step above is of interest).

    Thursday, May 27, 2010 9:46 AM
  •  

    I added the explicit reference to the VS and still get an error, but it has changed. Here is some of it:

    The CreateRiaClientFilesTask task has unexpectedly failed.

    System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. at System.IDisposable.Dispose()

    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTaks.GenerateClientProxies()

    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal() ...

    I ran this also with MSBUILD and got the same result. 

     Also - as you asked - my ProgramFiles environment variable is c:\Program Files

    Thursday, May 27, 2010 10:14 AM
  • Interesting and unexpected... the AppDomain was unexpectedly torn down.  I need to dig some more for that one. 

    There is one more thing we can try, and if it does not pan out, then we must repro this on our machines to debug.   Let me know if you're okay trying this.  It involves adding the Tools assembly to the GAC to ensure how it is loaded.

    1. Remove that reference to the Tools assembly from the project and close VS

    2. Open a VS CMD prompt

    3. cd to %ProgramFiles%\Microsoft SDKs\Ria Services\v1.0\Libraries\Server (where that assembly lives)

    4. Run "gactuil /i Microsoft.ServiceModel.DomainServices.Tools.dll"

    5. Try it out

    To undo these steps:

    1. Open a VS CMD prompt

    2. Run (from any folder) "gactuil /u Microsoft.ServiceModel.DomainServices.Tools"  (note there is no .dll on that name)

    Note that if this works, it would be a viable workaround *but* you would need to follow those steps to remove this assembly from the GAC manually.  The normal uninstall of WCF RIA Services would not know about it.

    We are going to continue trying to repro this internally.  These steps you're taking provide great feedback.

    Thursday, May 27, 2010 10:32 AM
  • Adding it to gac did not work, either for VS or MSBUILD.  Note: I removed the explicit file reference that we had tried in the previous step from the Web project.

    I'm continuing to try to repro the problem on my Window7 box, but in the meaintime, here is the error part of the log from MSBUILD:

     Build FAILED.

    "C:\(work)\avatar\source\ImageRequest1\imagerequest1.sln" (default target) (1) ->
    "C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj.metaproj" (default target) (2) ->
    "C:\(work)\avatar\source\ImageRequest1\ImageRequest1.Web\ImageRequest1.Web.csproj" (default target) (3) ->
    "C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj" (default target) (4:2) ->
    (CreateRiaClientFiles target) ->
      C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018: The "CreateRiaClientFilesTask" task failed unexpectedly.\r [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]
    C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.\r [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]
    C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018:    at System.IDisposable.Dispose()\r [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]
    C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.GenerateClientProxies()\r [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]
    C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal()\r [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]
    C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.RiaClientFilesTask.Execute()\r [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]
    C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\r [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]
    C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [C:\(work)\avatar\source\ImageRequest1\ImageRequest1\ImageRequest1.csproj]

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:06.81

    Thursday, May 27, 2010 11:15 AM
  • Thanks and sorry we're not getting any closer.  Let me work with our test team to try to duplicate your environment.  You've helped narrow this to a pretty core part of the code gen task and to eliminate VS and Intellisense as culprits.

    The AppDomain shutdown we see in your exception trace is unexpected and will need debugging in our labs.

    The experiment with Win 7 will be interesting just to try to isolate OS differences.

    Thursday, May 27, 2010 11:54 AM
  • I have a brand new laptop with 2 partitions.

    Newest install after a 2 GB memory upgrade (now 4 in total) is with Windows 7 x64 Ultimate (MSDN).

    RTM of VS 2010 Premium (MSDN).

    All the tools/install according to /getstarted!

    Repro:

    Open VS, New Project, SL Business Application, it builds by itself fine. Hit F5 when VS indicates it is Ready, error:

    Error 1 The "CreateRiaClientFilesTask" task failed unexpectedly. etc.

    Hit F5 again and the project runs fine.

    Thursday, May 27, 2010 1:34 PM
  • Thanks for staying with this. I'll keep investigating on this end and I'll post things here in this thread as I find them.

    Thursday, May 27, 2010 3:37 PM
  •  So here's some food for thought:

     ! took the microsoft.servicemodel.domainservices.toolkit.dll and ran the dependency checker on it.

    It was not happy because it was missing something called IESHIMS.DLL.

    I found one of those under %ProgramFiles%\Internet Explorer and moved it to my Windows folder.

    I no longer get that error in VS, and the client web.g.cs file appears to build just fine.

    I know this is not the right solution, but perhaps it will help you. Let me know.

    Thanks.

     

    Thursday, May 27, 2010 4:30 PM
  • This morning I tried to put my computer back to normal by removing the microsoft.servicemodel.domainServices.tools from the gac and the error returned, so I put it back in the gac but the error remains, but with a slightly different error:

    The "CreateRiaClientFilesTask" task failed....

    Invalid ObjRef provided to 'Unmarshal' at system.runtime.remoting.remotingServices.internal Unmarshal ... etc.

    I cannot seem to get back to where I was (with no error) by adding references, etc.   Very confusing.

     On a more positive note, my Windows7 installation seems to work fine, so I'll continue to work there for the time being.

    Let me know how/when I can help.

    Thanks.

    Friday, May 28, 2010 6:55 AM
  • We have set up several of our lab machines with different system config trying to repro the issue.  However, no luck so far.  It seems hard to repro with the fresh machines.  We'll keep investigating the issue.   

    Thanks for everybody's help here.  We really appreciate the observations you posted.  Please keep posting what you found.

    Friday, May 28, 2010 5:09 PM
  • On an existing project, I regularly get the error reported above. (It is sometimes failing, not always).

    Now, I just received this:

     

    Warning	1	Assembly 'System.Windows.Controls.Toolkit.Internals, Version=4.0.5.0, Culture=neutral, PublicKeyToken=2c5c654d367bf4a7' could not be loaded and will be ignored.
    Could not load file or assembly 'System.Windows.Controls.Toolkit.Internals, Version=4.0.5.0, Culture=neutral, PublicKeyToken=2c5c654d367bf4a7' or one of its dependencies. The system cannot find the file specified.	DeeBeeAdmin
    
      

    And

     

    Error	2	The "CreateRiaClientFilesTask" task failed unexpectedly.
    System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
       at System.IDisposable.Dispose()
       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)	DeeBeeAdmin
    
      

     

     

     

     

    Sunday, May 30, 2010 8:28 AM
  • As you can tell, we are having difficulties reproducing this problem, though it's obviously happening in certain scenarios.   This is why the repro steps are so important to help us resolve this.

    Can you isolate when it fails?  The fact it is intermittent is significant.  Specific tests I would try would include (a) closing all open files and building, (b) building from the CMD line (msbuild myApp.sln), etc.

    And this is happening on your Win 7 machine?   By "existing project" do you mean one you built new in SL 4.0?   That exception message indicates you are using the Silverlight Toolkit.   Where does the Properties window say that assembly is located?

    We'd really like to get to the bottom of this one.

    Tuesday, June 01, 2010 10:51 AM
  •  I never got the message again after rollback of Vista update. KB967723, KB978542, KB970430, KB981793, KB890830

    Tuesday, June 01, 2010 11:22 AM
  • First to make sure we are on the same page:
    - WCF RIA Services V1.0 for Visual Studio 2010, version 4.0.50506.0
    - Visual Studio 2010, version 10.0.30319.1 RTMRel
    - Hotfix for VS 2010 - KB 982218
    - Silverlight 4 and Silverlight 4 SDK, version 4.0.50401.0
    - Silverlight Tools for Visual Studio 2010, version 10.0.30319.161
    - Silverlight 3 SDK, version 3.0.40818.0
    - Expression Blend SDK RC for Silverlight 4, 2.0.20421.0

    Repro steps:

    - Open Visual Studio 2010
    - File, New Project
    - Silverlight, Silverlight Business Application
    - Press F5 when 'Ready'
    - If you experience no errors,
    - Close browser,
    - Press F5 again, until:
    - Error:

    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.<snip/>

    - Close MainPage.xaml
    - Press F5, can not reproduce error.
    - Close Visual Studio
    - Open BusinessApplicationX
    - Press F5, until: error above. (In my case, after the first time I pressed F5)

    Specific tests I would try would include (a) closing all open files and building, (b) building from the CMD line (msbuild myApp.sln), etc.

    No build failures with MSBuild.

    All this happens on my Windows 7 Ultimate x64 machine with Windows Security Essentials, fully up-to-date.

    My other 'existing' project is a project I started to develop on a different config and carried over to my current setup. It also 'sometimes' fails to build with the errors reported above.

    Regarding the file 'Microsoft.ServiceModel.DomainServices.Tools': I don't have a reference in my project to this assembly (not client/or server). All is according to the Silverlight Business Application template.

    HTH, Regards,

    Si

     

    Tuesday, June 01, 2010 1:36 PM
  • Great steps -- thank you.  We'll keep trying to find the right environment or machine.

    Incidentally, are you using C# or VB?  And when you started VS, did you choose C# or VB as the style to use?

    The intermittent aspect of this points to issues like background intellisense, and there are code paths unique to each language.

    BTW, asking to close all windows before a build is my indirect way of asking you to take intellisense out of the picture

    Tuesday, June 01, 2010 2:01 PM
  • I'm using C#, IIRC I choose 'General Development Settings'.  (But it might have been the C# settings).

    This might not be related, but it might, so here goes:

    I experience intermittend freezes on my system, mostly when hovering over the task bar (Aero peek is off BTW). IE8 is running when it happens.

    I followed the steps in http://support.microsoft.com/kb/929135 to 'Clean Boot'.

    It didn't resolve my freeze issue and although it appeared to have solved my 'CreateRiaClientFilesTask', I just received the error again, so ... we need to look a bit deeper.

    The word 'intermittend' triggered me to provide this info.

    HTH

    UPDATE:

    Just had the error again. 'Normally' after pressing F5 again, the project builds and runs, but this time I got this:

    Error 1 The "CreateRiaClientFilesTask" task failed unexpectedly.
    System.ArgumentException: Invalid ObjRef provided to 'Unmarshal'.
       at System.Runtime.Remoting.RemotingServices.InternalUnmarshal(ObjRef objectRef, Object proxy, Boolean fRefine)
       at System.Runtime.Remoting.ObjRef.GetRealObjectHelper()
       at System.Runtime.Remoting.ObjRef.GetRealObject(StreamingContext context)

       at System.Web.Compilation.BuildManagerHost.get_ApplicationHost()
       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) DeeBeeAdmin

    Tuesday, June 01, 2010 2:58 PM
  • I'm also getting the CreateRiaClientFilesTask task failed unexpectedly error. However, it's a different assembly specified than most others. here's the error message:- Error 7 The "CreateRiaClientFilesTask" task failed unexpectedly. System.Web.HttpException (0x80004005): Could not load file or assembly 'Microsoft.Web.DomainServices.WebControls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) ---> System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Web.DomainServices.WebControls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Web.DomainServices.WebControls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Web.DomainServices.WebControls' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) --- 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) SilverlightStore Repro steps. very easy, just download the updated 'Silverlight Store' POCO & SEO sample WCF RIA Services app and try to build it. I tried a 'Clean Solution' followed by a 'Rebuild Solution', but still get the same error. Tried it on 2 different m/c's. both Win7, one is Pro, the other is Ultimate, both 64 bit. VS2010, .net 4, SL 4, SL 4 toolkit which includes WCF RIA Services v1.0 HTH
    Sunday, June 06, 2010 10:27 PM
  • It's OK, i found my solution here: http://forums.silverlight.net/forums/t/169680.aspx
    Monday, June 07, 2010 12:56 AM
  • Thanks for getting back about the solution.

    For others on this thread, please be aware there are multiple distinct issues that can manifest as "CreateRiaClientFiles task failed" simply because it is the exception backstop for the code-generation part of the build.  In this case, the WebControls assembly was corrupt or not fully signed (meaning it was appropriate to fail an attempt to load it).   The exception originated deep in a piece of framework code called by the code generator.

    If you encounter this error message, know that the actual problem lies deeper, and the stack trace will generally provide more information (as it did above).

    Monday, June 07, 2010 8:32 AM
  • I am having the same problem, maybe you can duplicate.

    First, the SL4 Business Application developed with VS2010/Windows7 with RIA Services.

    The Server is Windows 2008R2.  Clean Installation, with Application Server, File Services, and Web Server Roles.

    1. Open IIS 7, create new website.
    2. Found that by default it creates a new application pool, but this app pool is set to target .NET framework 2.0, so I changed this to target v4.0
    3. In the website directory for this web app, I copied the bin, client bin, web.config, and default.aspx page which hosts the SL4 app.
    4. I checked that the MIME types are set for silverlight .xap files
    5. I check that the scripts are not set to execute for this website.
    6. I get the following error when trying to load the default page.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

    Stack Trace:

    [FileNotFoundException: Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
       System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
       System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +314
       System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +95
       System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +124
       System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +76
    
    [ConfigurationErrorsException: Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
       System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +11355388
       System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +69
       System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +62
       System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +301
       System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1332
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +149
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375
    
    [HttpException (0x80004005): Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4782309
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

    Friday, June 18, 2010 1:00 PM
  • Eagleeye6, this sounds like a assembly reference/resolvement issue.

    Make sure you installed WCF RIA with the /server=true switch (IIRC, make sure you check deployment threads in this forum)

    Or make sure you include (by setting 'copy local = true') the referenced dll's.

    HTH

    Sunday, June 20, 2010 2:24 AM
  • Hello Ron, This is an issue that has been with my VS2010 installation since a fresh install of Windows 7 64 bit, VS2010 Ultimate and Silverlight4_Tools. The error:

    Error 1 The "CreateRiaClientFilesTask" task failed unexpectedly. System.ArgumentException: Invalid ObjRef provided to 'Unmarshal'. at System.Runtime.Remoting.RemotingServices.InternalUnmarshal(ObjRef objectRef, Object proxy, Boolean fRefine) at System.Runtime.Remoting.ObjRef.GetRealObjectHelper() at System.Runtime.Remoting.ObjRef.GetRealObject(StreamingContext context)

    appears regularly, in fact virtually every other build. Press F6 once, it fails with the above message, press F6 again and it builds OK. Change something, F6, build fails, F6 again builds OK, Get the picture.

    As before, with the data source problem when Xiaoying Guo tracked down the problem, I am willing to let your people play on the machine via remote access if they want to try and track down the issue.

    Tuesday, June 29, 2010 4:57 AM
  • @roncain

    Windows 7 Ultimate x64

    Completely clean install of all release code:

    VS2010
    SL4
    RIA

    If I do a Rebuild Solution all I get the "CreateRia..." error every time. Does not matter if other apps/files/windows are open or not. If I use Build Solution I get the error on the first execution - the next Build Solution will succeed. Note that I am doing a Clean Solution before starting either set of steps.

    Portions of our solution were created using earlier versions of the software (RCs and Betas).

    I have not yet tried the command line build, nor have I tried creating a project from scratch per previous repro steps. I will do both and report.

    Below is my stack trace. For readability I replaced the full path with a <path> token. This is the full path: C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5)

    <path>: error : Thread was being aborted.
    <path>: error MSB4018: The "CreateRiaClientFilesTask" task failed unexpectedly.
    <path>: error MSB4018: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
    <path>: error MSB4018:    at System.IDisposable.Dispose()
    <path>: error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.GenerateClientProxies()
    <path>: error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal()
    <path>: error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.RiaClientFilesTask.Execute()
    <path>: error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    <path>: error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

    Wednesday, September 01, 2010 4:40 PM
  • Thanks for the clear steps.

    Do you see this behavior on new solutions too?  Or does it happen only on the solutions created with earlier RC's?

    We haven't found the cause of this exception, but it smells like an assembly of a prior RC getting into the mix somehow.   It might be useful to review whether any of the *.ServiceModel.DomainServices.*.dll assemblies have been "Copy Local"'ed into a bin or obj folder.

    If it also happens on new solutions, then we need to think about stuff left in the GAC, or possibly the $ProgramFiles$ folders where we install.

     

    Wednesday, September 01, 2010 4:52 PM
  • @roncain

    OK, I hope this isn't a tangent, but... I created a brand new Silverlight - Silverlight Business Application. I run Clean Solution and then Rebuild Solution and I get the stack trace below (<path> token substitution same as previous post). If I Clean Solution and then Build Solution it compiles with no errors.

     

    <path>: error MSB4018: The "CreateRiaClientFilesTask" task failed unexpectedly.
    <path>: error MSB4018: 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.
    <path>: error MSB4018: File name: 'Microsoft.ServiceModel.DomainServices.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
    <path>: error MSB4018:    at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
    <path>: error MSB4018:    at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
    <path>: error MSB4018:    at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
    <path>: error MSB4018:    at System.Type.GetType(String typeName, Boolean throwOnError)
    <path>: error MSB4018:    at System.Web.Hosting.HostingEnvironment.CreateWellKnownObjectInstance(String assemblyQualifiedName, Boolean failIfExists)
    <path>: error MSB4018:    at System.Web.Hosting.HostingEnvironment.CreateWellKnownObjectInstance(String assemblyQualifiedName, Boolean failIfExists)
    <path>: error MSB4018:    at System.Web.Hosting.ApplicationManager.CreateObjectInternal(String appId, Type type, IApplicationHost appHost, Boolean failIfExists, HostingEnvironmentParameters hostingParameters)
    <path>: error MSB4018:    at System.Web.Hosting.ApplicationManager.CreateObjectInternal(String appId, Type type, IApplicationHost appHost, Boolean failIfExists)
    <path>: error MSB4018:    at System.Web.Compilation.ClientBuildManager.CreateObject(Type type, Boolean failIfExists)
    <path>: error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.CreateSharedTypeService(ClientBuildManager clientBuildManager, IEnumerable`1 serverAssemblies, ILogger logger)
    <path>: error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.GenerateClientProxies()
    <path>: error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal()
    <path>: error MSB4018:    at Microsoft.ServiceModel.DomainServices.Tools.RiaClientFilesTask.Execute()
    <path>: error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    <path>: error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
    <path>: error MSB4018:
    <path>: error MSB4018: WRN: Assembly binding logging is turned OFF.
    <path>: error MSB4018: To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    <path>: error MSB4018: Note: There is some performance penalty associated with assembly bind failure logging.
    <path>: error MSB4018: To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    <path>: error MSB4018: 
     

    Wednesday, September 01, 2010 7:03 PM
  • @roncain

     

    I ran the command line clean and build against my production solution and the compile was successful.

     

    msbuild /t:clean GAReports.sln

    msbuild /filelogger /property:Configuration=DebugNoInstaller GAReports.sln

    <...>

    Build succeeded.
        0 Warning(s)
        0 Error(s)



    Not sure if this helps... I also opened the solution within VS2010 and did a Clean Solution. I then ran the command line compile with the solution stilll open in VS2010 and it compiled successfully.

    Wednesday, September 01, 2010 7:07 PM
  • @roncain

    I ran "gacutil -l" and all instances of *.ServiceModel.DomainServices.* are version 4.0.0.0

     Microsoft.VisualStudio.ServiceModel.DomainServices.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
     System.ServiceModel.DomainServices.EntityFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
      System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
      System.ServiceModel.DomainServices.Hosting.OData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
      System.ServiceModel.DomainServices.Server, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL

    I noticed that some *.ServiceModel.* modules are from a earlier versions.

     Microsoft.ServiceModel.Channels.Mail, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
      Microsoft.ServiceModel.Channels.Mail.ExchangeWebService, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
     System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
      System.ServiceModel.Install, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
      System.ServiceModel.WasHosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
      System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL

    and also two different versions of this:

     Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
     Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL

    and this:

     Microsoft.VisualStudio.ServiceModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
     Microsoft.VisualStudio.ServiceModel, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL

    Wednesday, September 01, 2010 7:27 PM
  • It is the permission problem. Simply start Visual Web Developer as Administrator and build the solution as it says FileNotFound. 

    Friday, September 10, 2010 12:57 PM
  • @t2hk

    Thanks, but that does not resolve my issue.

     

    Friday, September 10, 2010 1:33 PM
  • FWIW, I can not reproduce this error any more.

    I don't exactly know what fixed it, but ever since my system stopped 'freezing' after an update of the video driver (Lenovo finally released a fix!) and a few windows updates later, this error disappeared.

    Hope it gets solved for everyone.

    Monday, September 20, 2010 9:34 AM
  • Batpox, I'm having exactly the same issue as you described.

    I've tried dependency cheker and it also found missing IESHIMS.DLL and a few others. Downloaded these dlls from internet and saved to Windows folder. Still no success with building project, same AppDomainUnloadedException.

    Also Dependency Walker shows shows "Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module". But I don't know how to resolve this one.

    Did you have only IESHIMS.DLL missing?

    Wednesday, November 10, 2010 3:28 PM
  • I have been experiencing the same error.  However, it only occurs when my project is built on a drive other than my C: drive.  I do not know if it is because that's where Windows 7 is installed, or if it is the first drive, or what. 

    I've got c,d,g,i,j local drives.  C: is a raid set.  all of the others are local drives, non-raid...some compressed, some not.

    It does not matter what type of Silverlight application I attempt to build or whether or not RadControls are used (latest versions of everything, btw).  Create the project/solution on any other drive other than c:, and I get the error.

    It also does not matter whether I create the solutions in a nested directory structure or off of the root of the drive.

    Wednesday, December 08, 2010 12:21 PM
  • I have found that the RIA services seems to be very touchy with changes to its drives, if you try to move it from one drive to another, you have to do a clean, then build each project one by one, I usualy start with the web then the silverlight app.  Sometimes I have had to clean and build each app twice and then it starts working.  Also if you have a reference in your project to a DLL that is not on your local drive it will give you that message.

    So I assume there is some drive reference issues that need to be looked at.  Its a pain in the butt though, I was trying to show another developer on his machine how to use silverlight and we started with the Business app template, and every third change he has to clean everything and build he cant just hit run to test it.  I hope someone somewhere is working to fix this problem, I cant see it can be that hard to get the errors to show up, I can reproduce this problem at will on at least 5 different computers.

    Hope some of this info helps.

    Wednesday, December 08, 2010 3:12 PM
  • On my end it is the other way around.  We have a build system that was not updated for 3 months, and we had no problem building with SL4, RIA, and VS2010.  This is on Windows Server 2008(?) SP2 64-bit.

    After installation of the following updates (through Windows Update) the 'AppDomainUnloadedException' problem suddenly appears, intermittently:

    • KB2416400
    • KB2305420
    • KB2296199
    • KB2442962
    • KB2419640
    • KB2443685
    • KB2467659
    • KB890830
    • KB2436673
    • KB2423089

    I hope this information is useful to anyone out there...

    Tuesday, February 01, 2011 10:31 AM
  • Good news: our 'AppDomainUnloadedException' problem disappears after uninstalling KB2419640 (http://support.microsoft.com/kb/2419640) which is detailed in MS11-002 (http://www.microsoft.com/technet/security/bulletin/ms11-002.mspx): "Vulnerabilities in Microsoft Data Access Components Could Allow Remote Code Execution".

    At least, the problem did not occur in ten builds in a row, while before it occurred about every other build.

    So for now I've hidden this update so that it is not accidentally installed again, and we'll create a support case with Microsoft.

    UPDATE: The problem just came back, so it was not (just) KB2419640. Sigh.

    Tuesday, February 01, 2011 1:45 PM
  • I've encounter this problem if my project.web proj directory has been set to read-only. This is mainly occurs due to our source control. Make sure your project dirs have read/write ability.

    Sunday, February 27, 2011 3:23 PM
  • We finally figured out what the problem was: McAfee interfered with files in the 'Temporary ASP.NET Files'.  See http://stackoverflow.com/a/22940511/223837, and the other answers and the related questions, for several solutions.



    Tuesday, April 08, 2014 2:48 PM
  • We finally figured out what the problem was: McAfee interfered with files in the 'Temporary ASP.NET Files'.  See http://stackoverflow.com/a/22940511/223837, and the other answers and the related questions, for several solutions.



    Tuesday, April 08, 2014 2:48 PM