通过my_file.nuspec将文件从文件夹复制到其他文件夹

时间:2015-12-21 18:12:08

标签: c# asp.net visual-studio-2012 nuget

我有一个.nuspec文件。我需要将DLL File从文件夹复制到其他文件夹,但此文件不能作为此项目的参考。下面是我的xml文件(.nuspec):

<package>
    <metadata>
        <id>SisAmilNetRelatorios.Site.Paulo</id>
        <version>1.0.0</version>
        <authors>Cubo Tecnologia</authors>
        <description>01.SisAmilNetRelatorios.Site (Camada de apresentação)</description>
    </metadata>
    <files>
        <file src="SisAmilNetRelatorios.Site/AjaxControlToolkit/4.1.50731.0/AjaxControlToolkit.dll" target="lib/net40" />
        <file src="SisAmilNetRelatorios.Site/Interop.Shell32/1.0.0.0/Interop.Shell32.dll" target="lib/net40" /> 
        <file src="SisAmilNetRelatorios.Site/Microsoft.ReportViewer.WebForms/11.0.3442.2/Microsoft.ReportViewer.WebForms.dll" target="lib/net40" />
        <file src="SisAmilNetRelatorios.Site/Microsoft.ReportViewer.WinForms/10.0.40219.1/Microsoft.ReportViewer.WinForms.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.configuration.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Data.DataSetExtensions.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Data.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Drawing.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.ServiceProcess.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Web.ApplicationServices.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Web.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Web.DynamicData.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Web.Entity.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Web.Extensions.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.Web.Services.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.EnterpriseServices.dll" target="lib/net40" />
        <file src="NETFramework/v4.0/System.EnterpriseServices.Wrapper.dll" target="lib/net40" />
    </files>    
</package

&GT;

此文件无法重新引用,只是复制。

<file src="NETFramework/v4.0/System.EnterpriseServices.Wrapper.dll" target="lib/net40" />
        </files>  

这样就引用了它。此引用属于其他文件。

1 个答案:

答案 0 :(得分:0)

我想要的是不可能的。 NuGet包不能以这种方式工作。如果我的文件夹中有DLL,NuGet将安装它。如果有人需要,你必须手上安装。

关闭后。