none
msxsl:assembly reference across projects in same solution

    Question

  • How can I in an xslt in one visual studio project reference a library that is created by another project in the same solution - without having Visual Studio flag the reference as an red squiggly error ('Metadata file '(myprojectbuildoutput).dll could not be found')?


    • Edited by Lars K Friday, July 29, 2016 11:51 AM Minor edit
    Friday, July 29, 2016 11:51 AM

All replies

  • Hi Lars K,

    Did you mean you want to reference a library into a project?

    If so, please follow the steps below to add the project reference into another project which in the same solution:

    1.In Solution Explorer, select your target project that you want to add the project reference to.

    2.Right-click your project in Solution Explorer and then click Add Reference.The Add Reference dialog box is displayed.

    3.Click the Projects tab. From the list of available projects, select the one to which you want to add a reference and then click OK

    If I misunderstood your question, please feel free to let me know.

    Best Regards,

    Lake Xiao


    Monday, August 01, 2016 2:07 AM
    Moderator
  • Thx for the answer!

    The project in question does contain references to the correct assemblies. And all c# code in the project referencing classes from the referenced projects is perfectly fine.

    The problem is an msxsl:assembly reference from an xslt file in the project. Even though this reference is to an assembly built by another project in the same solution, and this other project is referenced by the project containing the xslt file, visual studio seems unable to resolve the reference and gives the msxsl:assembly tag a red squiggly and reports the error mentioned in my original post.

    In another circumstance I have had a similar msxsl:assembly reference to an assembly not in the solution but installed in the GAC. Visual studio resolved this reference without any problems.


    • Edited by Lars K Monday, August 01, 2016 10:15 AM Minor edits
    Monday, August 01, 2016 9:50 AM
  • Hi Lars K,

    Thanks for your response.

    >>The problem is an msxsl:assembly reference from an xslt file in the project. Even though this reference is to an assembly built by another project in the same solution,

    How about reference a class library project? Does it have the same problem. I think the problem was only happened for your scenario.

    >>I have had a similar msxsl:assembly reference to an assembly not in the solution but installed in the GAC. Visual studio resolved this reference without any problems.

    This is the best way to reference the assembly. If you still has the error when reference the project in the same solution. I think this is by design for your scenario. I suggest you could workaround this by  manually copy the .dll file into the GAC.

    Best Regards,

    Lake Xiao

    Tuesday, August 02, 2016 1:12 AM
    Moderator