Error in Build after Model Creation

4 posts, 0 answers
  1. Chris
    Chris avatar
    1 posts
    Member since:
    Nov 2013

    Posted 14 Nov 2013 Link to this post

    Hi,

    I'm getting the following error message in VS, when I build my Word 2010 AddIn after creating a Domain Model with OpenAccess:

    "Error    1    The "FindRibbons" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load file or assembly 'WordAddIn2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Das System kann die angegebene Datei nicht finden.
    File name: 'WordAddIn2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

    Server stack trace:
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.Load(String assemblyString)
       at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
       at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
       at System.Runtime.Serialization.ObjectManager.DoFixups()
       at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
       at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
       at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Build.Framework.ITask.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()"

    After deleting the Model, the project builds without errors.

    I found this discussion about the problem: http://connect.microsoft.com/VisualStudio/feedback/details/651634/the-findribbons-task-failed-unexpectedly
    It seems that there exists no solution, only workarounds. A reference to the assembly "SecurityTransparent" might cause this error.  

    My Setup is Windows 7 Pro, .NET 4.5, VS 2012, Telerik OpenAccess (all up2date).
    I reproduced the error on a different System with VS 2012 and VS 2013.

    Does anyone else have this problem or am i missing something?

    Thanks
  2. Dimitar Tachev
    Admin
    Dimitar Tachev avatar
    67 posts

    Posted 19 Nov 2013 Link to this post

    Hello Chris,

    Thank you for your feedback.

    Based on the information that you provided us I was able to reproduce this behavior.

    The error is caused by an exception in the FindRibbonTypes method of the FindRibbons task which is part of the build extensions from the Microsoft.VisualStudio.Tools.Office.targets file.

    In order to search for Ribbon Types this method is loading the WordAddIn assembly using the ReflectionOnlyLoadFrom method causing problems with our OpenAccessContext type and its dependencies.
    Assembly assembly = Assembly.ReflectionOnlyLoadFrom(assemblyName);
    Type[] types = assembly.GetTypes(); // exception

    Based of the above-mentioned information I suggest you create a separate OpenAccess Class Library project containing your domain model (the RLINQ file) and refer this project from the WordAddIn.


    I hope this is applicable for you. Do not hesitate to contact us back if you need any further information on Telerik OpenAccess ORM.


    Regards,
    Dimitar Tachev
    Telerik
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
  3. DevCraft banner
  4. Bob Mills
    Bob Mills avatar
    28 posts
    Member since:
    Aug 2009

    Posted 30 Oct 2014 in reply to Dimitar Tachev Link to this post

    I am having the same problem, but with an Outlook Add-In and the WPF Controls (Telerik.Windows.Controls.dll).  Do I need to create  a separate project that uses the controls?  Thanks.
  5. Boyan
    Admin
    Boyan avatar
    100 posts

    Posted 03 Nov 2014 Link to this post

    Hi Bob,

    Such behavior should not occur if an reference to Telerik.Windows.Control is made. In order to investigate this issue further could you please let us know:

    1. Do you have a Telerik Data Access model is you add-in project? If so please move it (for reasons described in the previous post) to another project and just reference it from your add-in project.

    2. Could you please describe the exact steps to reproduce this issue on your side?

    3. Is there some classes from Telerik.Windows.Control (or any other) assembly that were extended (inherited from) in your add-in project? This would cause the assembly (in which base classes are located in) to be loaded when GetTypes is called and possibly case the issue.

    I am looking forward to hearing from you.

    Regards,
    Boyan
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
Back to Top