2016-08-17 46 views
1

我不会将我的DLL中的一个封装在NuGet包中。Nuspec为NuGet包与UWP项目

该DLL使用Xamarin形式,将针对Android,iOS和UWP(通用于Windows)项目

这里是nuspec文件的部分:

<files> 
<!--Core--> 
<file src="Polux\CBS_CBT.Polux\bin\Release\CBS_CBT.Polux.dll" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\CBS_CBT.Polux.dll" /> 
<file src="Polux\CBS_CBT.Polux\bin\Release\CBS_CBT.Polux.pdb" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\CBS_CBT.Polux.pdb" /> 
<file src="Polux\CBS_CBT.Polux\bin\Release\CBS_CBT.Polux.xml" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\CBS_CBT.Polux.xml" /> 

<!--Xamarin.Android--> 
<file src="Polux\CBS_CBT.Polux.Droid\bin\Release\CBS_CBT.Polux.dll" target="lib\MonoAndroid10\CBS_CBT.Polux.dll" /> 
<file src="Polux\CBS_CBT.Polux.Droid\bin\Release\CBS_CBT.Polux.pdb" target="lib\MonoAndroid10\CBS_CBT.Polux.pdb" /> 
<file src="Polux\CBS_CBT.Polux.Droid\bin\Release\CBS_CBT.Polux.xml" target="lib\MonoAndroid10\CBS_CBT.Polux.xml" /> 
<file src="Polux\CBS_CBT.Polux.Droid\bin\Release\CBS_CBT.Polux.Droid.dll" target="lib\MonoAndroid10\CBS_CBT.Polux.Droid.dll" /> 
<file src="Polux\CBS_CBT.Polux.Droid\bin\Release\CBS_CBT.Polux.Droid.pdb" target="lib\MonoAndroid10\CBS_CBT.Polux.Droid.pdb" /> 
<file src="Polux\CBS_CBT.Polux.Droid\bin\Release\CBS_CBT.Polux.Droid.xml" target="lib\MonoAndroid10\CBS_CBT.Polux.Droid.xml" /> 

<!--Xamarin.iOS--> 
<file src="Polux\CBS_CBT.Polux.iOS\bin\iPhone\Release\CBS_CBT.Polux.dll" target="lib\Xamarin.iOS10\CBS_CBT.Polux.dll" /> 
<file src="Polux\CBS_CBT.Polux.iOS\bin\iPhone\Release\CBS_CBT.Polux.pdb" target="lib\Xamarin.iOS10\CBS_CBT.Polux.pdb" /> 
<file src="Polux\CBS_CBT.Polux.iOS\bin\iPhone\Release\CBS_CBT.Polux.xml" target="lib\Xamarin.iOS10\CBS_CBT.Polux.xml" /> 
<file src="Polux\CBS_CBT.Polux.iOS\bin\iPhone\Release\CBS_CBT.Polux.iOS.dll" target="lib\Xamarin.iOS10\CBS_CBT.Polux.iOS.dll" /> 
<file src="Polux\CBS_CBT.Polux.iOS\bin\iPhone\Release\CBS_CBT.Polux.iOS.xml" target="lib\Xamarin.iOS10\CBS_CBT.Polux.iOS.xml" /> 

<!--uap--> 
<file src="Polux\CBS_CBT.Polux.UWP\bin\Release\CBS_CBT.Polux.dll" target="lib\UAP10\CBS_CBT.Polux.dll" /> 
<file src="Polux\CBS_CBT.Polux.UWP\bin\Release\CBS_CBT.Polux.pdb" target="lib\UAP10\CBS_CBT.Polux.pri" /> 
<file src="Polux\CBS_CBT.Polux.UWP\bin\Release\CBS_CBT.Polux.xml" target="lib\UAP10\CBS_CBT.Polux.xml" /> 
<file src="Polux\CBS_CBT.Polux.UWP\bin\Release\CBS_CBT.Polux.UWP.dll" target="lib\UAP10\CBS_CBT.Polux.UWP.dll" /> 
<file src="Polux\CBS_CBT.Polux.UWP\bin\Release\CBS_CBT.Polux.UWP.pdb" target="lib\UAP10\CBS_CBT.Polux.UWP.pdb" /> 
<file src="Polux\CBS_CBT.Polux.UWP\bin\Release\CBS_CBT.Polux.UWP.pri" target="lib\UAP10\CBS_CBT.Polux.UWP.pri" /> 
<file src="Polux\CBS_CBT.Polux.UWP\bin\Release\CBS_CBT.Polux.UWP.xml" target="lib\UAP10\CBS_CBT.Polux.UWP.xml" /> 

问题:

当我运行该应用程序时,只有CBS_CBT.Polux.UWP.dll被复制到\ Debug目录中,其他文件(主要是CBS_CBT.Polx.dll)都没有复制到输出(例如\ Debug)目录中。然后,该软件抛出:

的类型“System.IO.FileNotFoundException”的异常出现在 mscorlib.ni.dll但在用户代码中没有处理

其他信息:无法加载文件或程序 'CBS_CBT.Polux,Version = 0.3.0.0,Culture = neutral,PublicKeyToken = null' 或它的一个依赖关系。

当我手动添加只有“CBS_CBT.Polux.dll”和“CBS_CBT.Polux.UWP.dll”到UWP项目的引用,该软件可以在没有任何问题运行。

+0

合作顺便说一下,我们刚刚更新了我们的文档,以帮助澄清这一情况多一点。以下文档有帮助吗? https://docspreview.nuget.org/ndocs/guides/create-uwp-packages –

回答

0

谢谢Unni Ravindranathan,在阅读文档后,我可以更正我的代码。

我必须改变的唯一部分是“核心”一个。

这里是回环nuspec代码:

<!--Core--> 
<file src="Polux\CBS_CBT.Polux\bin\Release\CBS_CBT.Polux.dll" target="lib\portable-net45+win8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\CBS_CBT.Polux.dll" /> 
<file src="Polux\CBS_CBT.Polux\bin\Release\CBS_CBT.Polux.pdb" target="lib\portable-net45+win8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\CBS_CBT.Polux.pdb" /> 
<file src="Polux\CBS_CBT.Polux\bin\Release\CBS_CBT.Polux.xml" target="lib\portable-net45+win8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\CBS_CBT.Polux.xml" />