Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

NullReferenceException when exploring nugets generated using new csproj format



  • Hello,

    we are running Azure DevOps on premise with the latest build agents on W10 machines.
    Some of our project use the new CSProj format like this:

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFramework>net452</TargetFramework>
        <Description>removed</Description>
        <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="JWT" Version="8.4.1" />
        <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
      </ItemGroup>
    </Project>
    

    After building the agent pushed these nupkg's to the Azure DevOps Artifacts. This feed is connected to a ProGet connector. I can see all packages but if I have chosen one of the packages generated from the new CSProj's I get (500) Server Error, object reference not set to an instance of an object. The log file shows this call stack.

    User: Admin
    User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
    Stack trace: bei Inedo.ProGet.WebApplication.Pages.Packages.Versions.ListPackageVersionsPageBase.<CreateChildControlsAsync>d__47.MoveNext()
    --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
    bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    bei Inedo.ProGet.WebApplication.Pages.ProGetSimplePageBase.<InitializeAsync>d__10.MoveNext()
    --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
    bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    bei Inedo.Web.PageFree.SimplePageBase.<ExecutePageLifeCycleAsync>d__51.MoveNext()
    --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
    bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    bei Inedo.Web.PageFree.SimplePageBase.<ProcessRequestAsync>d__50.MoveNext()
    --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
    bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    bei System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
    bei Inedo.Web.Handlers.AsyncHandlerWrapper.EndProcessRequest(IAsyncResult result)
    bei System.Web.HttpApplication.CallHandlerExecutionStep.InvokeEndHandler(IAsyncResult ar)
    bei System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
    

    The Inedo support team pointed out that there is something missing in the csproj resulting in a malformed nuspec. That's why they kindly asked me to provide the generated nuspec for the csproj as well. So here we go...

    <?xml version="1.0" encoding="utf-8"?>
    <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
      <metadata>
        <id>Example</id>
        <version>22.110.92-beta</version>
        <authors>example</authors>
        <description>Example</description>
        <copyright>(C) 2021</copyright>
        <tags>Example</tags>
        <repository type="git" url="https://our.azure-devops.server/tfs/DefaultCollection/our_project/_git/example" commit="1bc27034019bf556ce4f52d6be17430247fab9c6" />
        <dependencies>
          <group targetFramework=".NETFramework4.5.2">
            <dependency id="JWT" version="8.4.1" exclude="Build,Analyzers" />
            <dependency id="Newtonsoft.Json" version="11.0.2" exclude="Build,Analyzers" />
            <dependency id="Serilog" version="2.10.0" exclude="Build,Analyzers" />
            <dependency id="SerilogAnalyzer" version="0.15.0" exclude="Build,Analyzers" />
          </group>
        </dependencies>
      </metadata>
      <files>
        <file src="D:\agents\agent1\_work\25\s\example\bin\Release\net452\example.pdb" target="lib\net452\example.pdb" />
        <file src="D:\agents\agent1\_work\25\s\example\bin\Release\net452\example.dll" target="lib\net452\example.dll" />
        <file src="D:\agents\agent1\_work\25\s\example\bin\Release\net452\example.xml" target="lib\net452\example.xml" />
      </files>
    </package>
    

    Thanks,
    Jan


  • inedo-engineer

    Hi @jan_ko ,

    Thanks for sharing this; the .nuspec file looks okay to me, so it doesn't seem like a problem with the package.

    After building the agent pushed these nupkg's to the Azure DevOps Artifacts. This feed is connected to a ProGet connector.

    Well, I'm thinking the issue is in the Azure DevOps Artifacts API. We found many bugs in their feeds already (i.e. not implementing the API as specified). It happens to work in Visual Studio, or Visual Studio already worked around the bug.

    We can spot it very easily with a debugger; if you can share to use a feed url and credentials (I think it's just n access token?), then we can connect to the feed and see what's causing that error. You can send us the details via the ticket, so then it's not public.

    Cheers,
    Alana


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation