我想發佈具有引用其他的自定義組件(這是另一個NuGet包)的組件使用TFS組件爲獲得一個NuGet包來自VSTS的工作項目信息。生成正確nuspec文件......使用組件引用真實TFS時NullReference例外組件
當我發表我的包,並嘗試使用這個DLL,我得到每當我的代碼試圖訪問TFS NullReference例外。
要清楚,我已經發布這個插件NuGet包包含:
Plugin.dll組裝。
該組件具有一定的功能,這檢索TFS工作項的信息,做任何工作
而這些功能在TFSUtilities.dll組件(這也有它自己的NuGet包),它具有以下功能:訪問TFS 。
而這組件(TFSUtilities.dll)引用acutual TFS組件如 'Microsoft.TeamFoundation.WorkItemTracking.Client'
'Microsoft.TeamFoundation.WorkItemTracking.Proxy'
'Microsoft.TeamFoundationTestManagement.Common'。 ...等
所以在發佈我的Plugin.dll nuget包後,當我嘗試從另一個解決方案引用此包並調用Plugin.dll中的函數來訪問TFS工作項時,它只是給了我System.NullReferenceException試圖訪問TFS。
我想我不會產生正確的nuspec文件雖然。下面是我對plugin.dll nuspec文件的內容。
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Plugin</id>
<version>1.0.0.0</version>
<title>Plugin</title>
<authors>Custom</authors>
<owners>BCustom</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains custom assemblies</description>
<language>en-US</language>
<dependencies>
<dependency id="TFSUtilities" version="1.6.72" />
</dependencies>
</metadata>
<files>
<file src="..\bin\Release\Plugin.dll" target="lib\net452\Plugin.dll" />
<file src="..\bin\Release\Plugin.dll" target="build\Plugin.dll" />
<file src="..\bin\Release\TFSUtilities.dll" target="build\TFSUtilities.dll" />
<file src="..\bin\Release\Microsoft.TeamFoundation.WorkItemTracking.Client.dll" target="build\Microsoft.TeamFoundation.WorkItemTracking.Client.dll" />
<file src="..\bin\Release\Microsoft.TeamFoundation.Client.dll" target="build\Microsoft.TeamFoundation.Client.dll" />
<file src="..\bin\Release\Microsoft.VisualStudio.Services.Client.dll" target="build\Microsoft.VisualStudio.Services.Client.dll" />
<file src="..\bin\Release\Microsoft.VisualStudio.Services.Common.dll" target="build\Microsoft.VisualStudio.Services.Common.dll" />
<file src="..\bin\Release\Microsoft.TeamFoundation.Common.dll" target="build\Microsoft.TeamFoundation.Common.dll" />
<file src="..\bin\Release\Microsoft.VisualStudio.Services.WebApi.dll" target="build\Microsoft.VisualStudio.Services.WebApi.dll" />
</files>
</package>
我擡起頭,在互聯網上,它看起來像我可能需要增加更多的庫,例如WITDataStore64.dll或更多的東西,但我不完全得到它在說什麼。任何人都可以幫我解決這個問題嗎?僅供參考,我們的工作項目都在網上VSTS。
什麼是詳細代碼? –
你能分享你得到的詳細的異常信息嗎? –