Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error Of Creat Self Hosted WebApi In Revit By Owin

5 REPLIES 5
Reply
Message 1 of 6
andy.chen-OpenbimCN
484 Views, 5 Replies

Error Of Creat Self Hosted WebApi In Revit By Owin

Hi:

    I have create a wpf window with self hosted WebAPI  by owin, when the wpf start , the webAPI service will start with it.

 

    But when I try to integrate the wpf with webapi server in Revit, I get the following Exception.

    

    System.IO.FileLoadException

    
    Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

     I guess the Revit.exe has own version of Newtonsoft.Json.dll, and owin requires special version of Newtonsoft.Json.dll, so occurs dll version conflict,

So how can I set dependentAssembly of owin in revit? Is anyone deployed owin in revit or can help solve this issue?

 

    Any pointers would be appreciated, thanks a lot.

 

 

     

  

Tags (3)
5 REPLIES 5
Message 2 of 6

 

   It is worked,  after integrate Cef and Owin, We have an self host server and browser in Revit.

   I am very glad to use html5 to do UI instead Winform or Wpf, and I can use browser organize design reference material.

 

 

Message 3 of 6

Hi Andy,

 

I'm having a similar issue to you but with the System.Web.Http library. There's definitely an artifact/assembly available to the be used by Revit and my application but it seems to be ignoring it.

 

Can you give any more information on how you resolved your issue? Right now everything is working with OWIN except when I try to integrate it with Revit

Message 4 of 6

Hi:

       Your guess is correct, you can try it in attachment.

RGS

Andy

 

Message 5 of 6

Thanks Andy - I appreciate the attachment. Can you explain your process though? My project is already using Owin so I've got that part figured out. I'm just trying to understand what you changed so that, when running the addin in Revit, it's able to find all the appropriate artifacts.

 

Like I mentioned before, it's unable to find System.Web.Http even though it's right next to the running assembly. Any advice?

Message 6 of 6

According to my record,  do not use httpconfiguration Class and reference, and remove  Newtonsoft.Json and relative Formater, then it could be ok.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community