Locked Compiling code on the fly using Async

  • Tuesday, April 24, 2012 2:26 PM
     
      Has Code

    Hi,

    config : vs2010, .Net 4.0, async ctp3, silverlight 5

    I need to compile script on the fly. So, i created a class library project (server part) to compile a Silverlight class library with VBCodeProvider.

    I run it from the client and it works !!!

    now, i would like to compile async functions.

    in the CompilerParameters.ReferencedAssemblies, i add a reference to AsyncCtpLibrary_Silverlight5.dll

    DefaultReferencedAssembliesSilverlight = New String() {"C:\Temp\AsyncCtpLibrary_Silverlight5.dll", _
    	_silverlightRootFolder & "mscorlib.dll", _silverlightRootFolder & "system.dll", _
            _silverlightRootFolder & "System.Core.dll", _silverlightRootFolder & "System.Net.dll", _
            _silverlightRootFolder & "System.Windows.dll", _silverlightRootFolder & "System.Windows.Browser.dll", _
            _silverlightRootFolder & "System.Xml.dll"}
    

    (i moved AsyncCtpLibrary_Silverlight5.dll to the temp directory because the compiler could not find the library ??!!)

    but, i have this error :

    Cannot find all types required by the 'Async' modifier. Are you targeting the wrong framework version, or missing a reference to an assembly?

    Can you tell me if i'm doing something wrong or....if it is possible ?

    Thanks from France

    Greg

All Replies

  • Thursday, May 03, 2012 4:41 PM
     
     
    Anyone ?
  • Friday, May 18, 2012 8:37 AM
     
     Proposed
    You need to provide a little more information, I suggest you start by turning on Fusion logging.  Hanselman has a helpful post.  Even though this is happening during compilation, those types will be being loaded by MsBuild and a failure to find them will appear in your fusion logs.  The error will indicate where it's looking for the types and what it's looking for, so then you can add the missing dlls you need.

    thargy

    Craig Dean (MCPD)
    Chief Executive
    www.webappuk.com

    Please consider marking this as the answer if you have been genuinely helped!

    • Proposed As Answer by thargy Friday, May 18, 2012 8:37 AM
    •  
  • Monday, May 21, 2012 3:37 PM
     
     

    Thank you for your answer.
    I can not watch this week.
    but I'll tell you what I found
    thank you

  • Tuesday, June 19, 2012 1:53 PM
     
     Answered

    Sorry, I took a little time to respond.

    I have not found a solution. FusionLog is a little too dark for me.

    But I managed to run my project by moving on VS2012.

    Thank you for your time