2016-08-17 43 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" />