xantari / Seq.App.Azure.DevOps

Seq App for Azure DevOps (Team Foundation Server / TFS / Visual Studio Team Services / VSTS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating bug in DevOps

Inlustris opened this issue · comments

I'm getting the following issue when trying to create a Bug in DevOps.

System.AggregateException: One or more errors occurred. (Could not load file or assembly 'System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
) (Could not load file or assembly 'System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
)
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler..ctor(VssCredentials credentials, VssHttpRequestSettings settings)
   at Seq.App.Azure.DevOps.AzureDevOpsReactor.CreateIssue(Event`1 evt)


   --- End of inner exception stack trace ---

Did something change or did i something wrong?

Did it ever work?

Which version of Seq are you using?

It did never work i just set it up. and it is the version: Seq 2020.3.4761

OK I’ll look into it on the latest version of seq

Thanks, If it works i would like to use it.

Just did a fresh install into a new Seq instance and it worked successfully.

Can you confirm that you have installed the proper Azure DevOps app? There happen to be two of them listed in nuget.

It should look like this, notice the blue logo and the version # info.

https://www.nuget.org/packages?q=Seq.App.Azure.DevOps

image

Can it be because of running it on docker?

Dunno, could be. As far as I know docker instances are bare bones environments, perhaps you are missing the .NET Full Framework in your docker image? I'm not familiar with docker, but that's what would be my idea as to whats wrong.

Did you make this docker image yourself, or was it downloaded from somewhere?

It was downloaded from seq itself. But indeed i think this is the problem because it is running on linux based container and not windows container.

I tried it at work today on a non docker environment installed on the desktop itself. This worked fine.

So it appears that Microsoft now has .NET Standard compliant Nuget's for Azure DevOps / Team Foundation Server that could make this App cross platform. Let me look at changing the project definition so that it's targeted to .NET Standard to see if that would fix this.

So I have a branch that I converted to .net standard, but am having some issues getting it to load within Seq.

https://github.com/xantari/Seq.App.Azure.DevOps/tree/netstandard

Right now i'm stuck at this error. The .DLL is actually in the nuget package, so not sure whats going on.

@nblumhardt I really need some help here. What is wrong with my nuget package? Why isn't Seq 2020.3 loading it properly? Do I have something wrong with the way the nuget file is being generated?

image

I've dropped a copy of the .net standard 2.0 version here that i'm hoping @nblumhardt can help me debug: https://drive.google.com/file/d/1j9aHBfLAazNYnBAh4RNWYSx2VXfGEg4Y/view?usp=sharing

Howdy! There could be a couple of things going wrong -

Packaging - I'm not sure how the older-style CSPROJ files go with this anymore; as it happens, we just recently built and published an example plugin that targets .NET Standard 2.0, and includes a build script (Build.ps1) and CSPROJ that show how this is done: https://github.com/datalust/seq-app-opsgenie

One of the great improvements that project makes is that it uses launchSettings.json and seqcli to enable local F5 debugging (on .NET Core), so there's a good chance that will reveal the underlying issue.

Replacing the project file, build script, and launchSettings.json with ones based on that repository should get us closer.

The other possible issue (more likely) is that the Microsoft.TeamFoundation.* packages build on platform-specific APIs. It's not enough for the package to support .NET Standard, unfortunately - the packages referenced from the app need to be fully cross-platform in order to work in both versions of Seq. Just judging by the package name ( :-) ) I'd guess that's a strong possibility here.

Today is already full, for me, but I can circle back in the next couple of days and take a look if none of the above helps.

@nblumhardt Really stuck on this. Tried to clone the ideas from Opsgenie, but am now getting this:

image

It seems to create the nupkg, but it's super small and missing all the third party DLL's...

Branch with these changes: https://github.com/xantari/Seq.App.Azure.DevOps/tree/netstandard2

Hi @xantari - I made a little bit of progress -

  • First, I added -f netstandard2.0 to the dotnet publish invocations in build.ps1
  • To get the package built I then had to allow warnings in the CSPROJ (temporarily, I guess)

...and, the resulting package then has all the required files. But, it won't load because for some reason the Seq.App.Azure.DevOps assembly is being packaged under a nested netstandard2.0 folder.

I'm out of time to dig in further this morning, but thought I'd post my progress so far in case it sparks any ideas.

@nblumhardt Got a bit further. Here is what I did:

Updated .csproj to have this line:

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

Then created the following nuspec:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    <id>Seq.App.Azure.DevOps</id>
    <version>1.0.0</version>
    <authors>xantari, delubear</authors>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <license type="file">LICENSE</license>
    <licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
    <projectUrl>https://github.com/xantari/Seq.App.Azure.DevOps</projectUrl>
    <description>An app for Seq (https://getseq.net) that forwards events to Azure DevOps (VSTS / TFS)</description>
    <tags>seq-app seq serilog events azure devops tfs microsoft</tags>
    <repository type="git" url="https://github.com/xantari/Seq.App.Azure.DevOps" />
    <dependencies>
      <group targetFramework=".NETStandard2.0">
        <dependency id="Microsoft.TeamFoundation.DistributedTask.Common.Contracts" version="16.153.0" exclude="Build,Analyzers" />
        <dependency id="Microsoft.TeamFoundationServer.Client" version="16.153.0" exclude="Build,Analyzers" />
        <dependency id="Microsoft.VisualStudio.Services.Client" version="16.153.0" exclude="Build,Analyzers" />
        <dependency id="Seq.Apps" version="5.0.0" exclude="Build,Analyzers" />
      </group>
    </dependencies>
  </metadata>
  <files>
    <file src="bin\Release\netstandard2.0\Newtonsoft*.dll" target="lib\netstandard2.0" />
    <file src="bin\Release\netstandard2.0\Microsoft*.dll" target="lib\netstandard2.0" />
    <file src="bin\Release\netstandard2.0\System*.dll" target="lib\netstandard2.0" />
    <file src="bin\Release\netstandard2.0\Seq.App*.dll" target="lib\netstandard2.0" />
    <file src="C:\tfs\Seq.App.Azure.DevOps\LICENSE" target="LICENSE" />
  </files>
</package>

Ran this in Developer powershell:

 dotnet pack /p:NuspecFile=Seq.App.Azure.Devops.nuspec -c Release -o .nuget

Created the .Nuget without any warnings:

image

But back to the error here: https://user-images.githubusercontent.com/6610039/98192941-a8005100-1ee1-11eb-847f-67a1e37f86c5.png

This error occurs when you actually activate the plugin by adding an instance of it, then going to a log event and hitting Send To App >> Your instance name you created for the app...

No idea whats happening on why it can't find the DLL, it exists in the .nuget file (I looked with 7-zip).

Leaving this here for posterity sake:

Figured out what was going on!

I bet my nuget package update to make it .net standard 2.0 compliant was just fine for all this time, but I think I may have found some sort of issue in Seq.

It seems Seq was holding onto other nuget versions that I was playing with.

Even when I removed all instances of the app and uninstalled it from Seq it seems it was still holding on to the packages.

So when I would install what I thought was a new build of my package (had the same version number, but I had removed ALL previous instances of it from Seq), then it was just loading the old .nupkg that it had in it’s cache.

What I ultimately did to fix this is completely wiped out this folder: C:\ProgramData\Seq\Packages

After that I installed my nupkg file and everything started working after that.

@Inlustris This issue should now be fixed in 1.0.31 published to nuget.

Can you please try it again so we can confirm this seq app now works in your docker container?

Hi @xantari Just installed 1.0.31 on my local Seq in docker. Now it functions correctly.

Thanks for looking into this problem i really appreciate the effort.

For testing purposes i tried downgrading to 1.0.20 and can confirm it does not work.
After this upgrade back to version 1.0.31 and can confirm it started working again.

Thanks for testing!