简体   繁体   中英

Installing new Nuget packages failing in Azure (ASP.NET)

I have installed via Nuget a bunch of packages to do with SendGrid. Locally, this all works flawlessly. However, once it's deployed and working, I get the following exception thrown:

Exception Thrown: System.IO.FileLoadException: Could not load file or assembly 'SendGrid.SmtpApi, Version=1.1.3.0, Culture=neutral, PublicKeyToken=55aa52d3c3c0d2b2' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'SendGrid.SmtpApi, Version=1.1.3.0, Culture=neutral, PublicKeyToken=55aa52d3c3c0d2b2' at SendGrid.SendGridMessage..ctor() at seshpicker.Controllers.AccountController.<ForgotPassword>d__18.MoveNext() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 

I believe this may be because the new Nuget Sendgrid packages are probably not deployed. However, I do not know where they should go when they are live in Azure. I can't seem to find where all the other packages are stored either.

On my local machine, they are stored in the same directory as my visual studio solution file under a folder called packages. I have also included the references within the build.

Does anyone have any ideas?

Solved it!

Basically, I had a much newer version of SendGrid.SmtpApi (1.3) than what the parent dependency was looking for.

Downgrading to the exception mentioned version solved this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM