sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

ASP.NET .NET Framework Website (web.config) project with Sentry fails to builds on Azure build agent

Open edgariscoding opened this issue 10 months ago • 6 comments

Package

Sentry

.NET Flavor

.NET Framework

.NET Version

4.7.2

OS

Android

SDK Version

4.2.1

Self-Hosted Sentry Version

24.2.0

Steps to Reproduce

We have a large project and I'm trying to integrate Sentry into it. I got it to work flawlessly on my local environment, everything builds fine and it logs to our Sentry server.

But when I push my code to Azure and run a build pipeline on it, it fails with an error:

App_Code\Global.asax.cs(14,0): Error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Sentry' (are you missing an assembly reference?)

I installed Sentry, Sentry.AspNet, and Sentry.EntityFramework from Nuget. Like I said it all builds and works fine locally.

This type of ASP.NET website does not use a .csproj file, it instead uses only a web.config file.

I see that we currently have a number of compilation assemblies added to the web.config. For third party tools like DevExpress, etc. Do I need to add the sentry assemblies here? Was it supposed to add these lines automatically?

If I manually add an assembly to the web.config such as this:

...
    <add assembly="Sentry.AspNet, Version=4.2.1.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0" />
  </assemblies>
</compilation>

Then instead I get this error:

web.config(534,0): Error ASPCONFIG: Could not load file or assembly 'Sentry.AspNet, Version=4.2.1.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0' or one of its dependencies. The system cannot find the file specified.

I've verified that the packages are present in the packages directory. I've verified that the bin folder contains the necessary .refresh files for the packages with the correct path to the assembly within the packages folder.

We have plenty of other third party packages we use and have not run into this issue with any of them.

The error says that it couldn't load the assembly OR ONE OF ITS DEPENDENCIES. Could that be the problem? How do I figure out which dependency is not loading?

Expected Result

Expected the build to succeed.

Actual Result

Build error.

edgariscoding avatar Mar 26 '24 21:03 edgariscoding