c# - Generating correct nuspec file... NullReference exception when using assembly that's referencing TFS assemblies -


i'm trying publish nuget package has assembly references custom assembly(which nuget package) uses tfs assemblies getting work item information vsts.

when publish package , try use dll, i'm getting nullreference exception whenever code trying access tfs.

to clear, have published plugin nuget package contains :

plugin.dll assembly.

this assembly has functions retrieve information tfs work items , whatever work

and functions in tfsutilities.dll assembly(this has own nuget package) has functions access tfs.

and assembly(tfsutilities.dll) references acutual tfs assemblies such 'microsoft.teamfoundation.workitemtracking.client'
'microsoft.teamfoundation.workitemtracking.proxy'
'microsoft.teamfoundationtestmanagement.common' .... etc.

so after publishing plugin.dll nuget package, when try reference package solution , call functions in plugin.dll access tfs workitems, gives me system.nullreferenceexception whenver tries access tfs.

i think i'm not generating correct nuspec file though. below content of nuspec file plugin.dll.

<?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> 

i looked on internet , looks may need add more libraries witdatastore64.dll or more i'm not quite getting it's talking about. can me solving issue? fyi, our work items on vsts online.

refer these steps it:

  1. create class library project (e.g. tfsutilities)
  2. install microsoft.teamfoundationserver.extendedclient package
  3. copy code , paste project
  4. build project
  5. package project calling nuget.exe pack [project file path (tfsutilities.csproj)]

tfsutilities.nuspec code:

<?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">   <metadata>     <id>tfsutilities</id>     <version>1.0.0</version>     <title>tfsutilities</title>     <authors>ws</authors>     <owners>ws</owners>     <requirelicenseacceptance>false</requirelicenseacceptance>     <description>tfs api</description>     <copyright>copyright ©  2017</copyright>     <dependencies>       <dependency id="microsoft.teamfoundationserver.extendedclient" version="15.112.1" />       <dependency id="newtonsoft.json" version="8.0.3" />     </dependencies>   </metadata> </package> 
  1. publish package
  2. create class library project (e.g. plugin)
  3. install previous package (tfsutilites)
  4. coding
  5. package project calling nuget.exe pack [project file path (plugin.csproj)]

plugin.nuspec code:

<?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">   <metadata>     <id>plugin</id>     <version>1.0.0</version>     <title>plugin</title>     <authors>starain</authors>     <owners>starain</owners>     <requirelicenseacceptance>false</requirelicenseacceptance>     <description>description</description>     <copyright>copyright ©  2017</copyright>     <dependencies>       <dependency id="newtonsoft.json" version="8.0.3" />       <dependency id="tfsutilities" version="1.0.0" />     </dependencies>   </metadata> </package> 
  1. install plugin package other project , use it.

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -