none
Property of DLL is not set as excepted when downloading from Nuget

    Question

  • hi Team,

    we have one framework dll which was uploaded in my Nuget server. when we are downloading the framework package from nuget, the dlls properties are not set as excepted. It is set as below

    • Embed Interop Types : set as ‘True’ ( It should be False)
    • Copy Local : set as ‘False’ (It should be True)

    Please provide your suggestions on the same.

    Thank you in advance!

    Friday, November 30, 2018 11:30 AM

All replies

  • Hi Swarna Konda,

    This forum discusses and asks questions about the C# programming language, since your issue is more related to visual studio general, I'll move it to vs general forum for suitable support.

    Thanks for your understanding.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 3, 2018 6:00 AM
  • Hi Swarna Konda,

    What is the type of your nuget package? .net framework or .net core? NuGet package would not change the default value of the properties. Have you define some file, like .targets in your package? If possible, could you please share your .nuspec file here?  


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 3, 2018 7:34 AM
  • hi Leo,

    Thank you for the response.

    Please find the Version details as requested

     .Net framework : 4.7.03062 

    NuGet Package Manager : 2.8.603318.667.

    My Nuspec file contains the below information which contains target for adding 'interop.noripc.dll' dll in the package.

    <?xml version="1.0"?>
    <package >
      <metadata>
        <id>$id$</id>
        <version>$version$</version>
        <title>$title$</title>
        <authors>$author$</authors>
        <owners>$author$</owners>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>$description$</description>
        <copyright>Copyright 2016</copyright>
        <dependencies>
          <dependency id="Loke" version="[$version$]" />
          <dependency id="Loke.Web" version="[$version$]" />
          <dependency id="TM42" version="[4.2.2.1]" />
        </dependencies>
      </metadata>
      <files>
        <file src="bin\$configuration$\interop.noripc.dll" target="lib\net40\" />
        <file src="tools\net40\install.ps1" target="tools\net40\" />
      </files>
    </package>

    Please let me know if you need more details on the same.

    Thank you in Advance

    Thursday, December 6, 2018 1:36 PM
  • @Swarna Konda, Thanks for your reply. What is content in your install.ps1? Have you add any PS scripts in that .ps1 file to change the properties? Besides, I found your NuGet Package Manager is too old, still 2.8. Please try to update it if you are using the Visual Studio 2013 and above.


    MSDN Community Support Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 7, 2018 3:03 AM
  • @Leo, Thank you for your reply. 

    we have below content in the .ps1 file 

    param($installPath, $toolsPath, $package, $project)

    $vsRef = $project.Object.References.Item("Interop.NorIpc")
    if ($vsRef -and $vsRef.EmbedInteropTypes)
    {
        $vsRef.EmbedInteropTypes = $false
    }

    In the .ps1 file, we have given the dll property as 'false'  but not sure why it is updating with value as 'True'

    We are using Visual studio 2012 still. Is this issue is coming due to using old nuget manager ?

    Thank in advance!

    Friday, December 7, 2018 10:39 AM