DLL references from infopath form - InfoPath Dev
in

InfoPath Dev

DLL references from infopath form

Last post 08-15-2005 01:22 PM by jimbob. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 08-08-2005 08:09 AM

    DLL references from infopath form

    Hi all,

    I have a problem with infopath development. I design full trusted infopath form with C# code. Now I have a dll containing already C# written windows Form. The problem is when I put a reference to this dll inside an infopath form and try to use a form, Infopath give me a security exception ? It is possible to reuse such dll from infopath ? and how can I do it ?

    Thanks in advance

    Christophe
  • 08-08-2005 10:34 PM In reply to

    • Nagesh
    • Not Ranked
    • Joined on 07-21-2005
    • India
    • Posts 5

    Re: DLL references from infopath form

    Hi christophe,

    We can use such DLL in the infopath form.It worked for me by following the steps below,

    1) Go to VisualStudio.NET
    2) Click on "Add Reference" in Project menu
    3) Select .NET tab and click on the Browse button
    4) Select the DLL file and click Ok
    5) Now go to the infopath code and then import this namespace by "using" statement
    6) We can now call the methods in the DLL file through the classes in that namespace

    Hope this helps you..

    Nagesh
    InfoPath Dev India
  • 08-08-2005 10:46 PM In reply to

    • jimbob
    • Top 500 Contributor
    • Joined on 11-25-2004
    • USA
    • Posts 32

    Re: DLL references from infopath form

    What particular security exception are you seeing? And is your form digitally signed with a trusted root certificate?


    Jim Cantwell
    InfoPathDev - Redmond
    Jim Cantwell
    InfoPathDev - Redmond
  • 08-09-2005 02:44 PM In reply to

    Re: DLL references from infopath form

    Thanks for your responses,

    It is OK to make the link to the dll in VS studio, it works well.

    The problem is when I ask for a preview from VS studio and I click the button responsible to open the windows form from the DLL, an infopath windows appears with the following error message :

    System.Security.SecurityException
    Security error.
    at Form.Form.BrowseButton_OnClick(DocActionEvent e)
    at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)


    After that the form will be full trusted (I use the refForm Tool with an urn)

    Do you have any ideas ?

    Thank you very much

    Christophe
  • 08-09-2005 04:19 PM In reply to

    Re: DLL references from infopath form

    Hi Christophe,

    Are you using /FT for the Regform tool to make it Full Trust? If you run the MSI and install locally and run it, do you see an error?

    Note: the Preview mode doesn't support Full Trust so you need to attach to an already running InfoPath process to debug it (if it's Full Trust URN-based and RegForm generated).



    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-10-2005 02:36 PM In reply to

    Re: DLL references from infopath form

    Hi Patrick,

    Thank you ! You're right, when I published the form it works... one time only. After that I tried to update my dll and after that when I open my Infopath form, I have the following error message: File or assembly name SSInfopath, or one of its dependencies, was not found.

    I've tried to remove the reference and rebuilt, republish the form, I have still this error, I don't understand how to remove this link. The link disapears from the manifest.xsf.

    I have extracted the resulting xsn file and it does not contain the dll...

    Now one question : what is the best way to do this link ? it is possible/usefull for example to strong name the assembly and install it in the GAC. How to do this link to be able to update the dll file withtout republishing the infopath form ? Or how can I "put" this dll into the xsn file to avoid link problems ?

    Thank you very much for your most valuable help.

    Christophe
  • 08-10-2005 04:15 PM In reply to

    Re: DLL references from infopath form

    Hi Christophe,
    How am I right if it works only once!? :S I'm confused about what changed. Anyway, you'll need to include the assembly in your InfoPath project. I've asked Jim to respond with tips on how to do this.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-11-2005 06:40 AM In reply to

    Re: DLL references from infopath form

    Hi Patrick,

    You're right because when it works I didn't have the security exception, and now I think it is just a link problem.

    So now I wait for Jim's tips...

    Thank you very much

    Christophe
  • 08-11-2005 10:46 AM In reply to

    Re: DLL references from infopath form

    Hi Christophe,
    Sorry for the delay here. We've been busy. We'll try to respond with more info/questions tonight. Thanks for your patience.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-11-2005 10:53 AM In reply to

    Re: DLL references from infopath form

    Hi Patrick,

    OK no problem thank you

    Christophe
  • 08-11-2005 05:16 PM In reply to

    • jimbob
    • Top 500 Contributor
    • Joined on 11-25-2004
    • USA
    • Posts 32

    Re: DLL references from infopath form

    The 'File or assembly name SSInfopath, or one of its dependencies, was not found' error is most likely from the assembly not being in the xsn. If the form assembly is referencing this dll, it must reside in the .xsn or be installed in the GAC.

    In Visual Studio, check the 'Copy Local' property for the dll reference and make sure it is set to 'True'.
    You can find this property in the Solution Editor window, right-click on the dll reference under the 'References' node and select properties.

    And when you republish, make sure you are publishing to the location which you used with the RegForm tool.

    Jim Cantwell
    InfoPathDev - Redmond
    Jim Cantwell
    InfoPathDev - Redmond
  • 08-15-2005 07:13 AM In reply to

    Re: DLL references from infopath form

    Hi Jim,

    Thank you for your response. I have tried to set the 'Copy Local' property to True, the dll has been copied in my VSS working directory but it is still not included in the XSN file. In fact, I've tried to extract files from the xsn file and I was not able to find this dll.

    I have also tried to install the assembly into the GAC and it does not change anything !

    Do you have some more ideas ?

    Thank you very much in advance.

    Christophe
  • 08-15-2005 01:22 PM In reply to

    • jimbob
    • Top 500 Contributor
    • Joined on 11-25-2004
    • USA
    • Posts 32

    Re: DLL references from infopath form

    It sounds as if your project file may be corrupted.

    I recommend creating a new InfoPath solution, add a reference to the dll, and make sure Copy Local is True. Then publish the form, a blank form is sufficient, then check the xsn file to verify that it contains the dll.
    You can quickly view the xsn contents by changing the .xsn extension to .cab and open the file.


    Jim Cantwell
    InfoPathDev - Redmond
    Jim Cantwell
    InfoPathDev - Redmond
Page 1 of 1 (13 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.