YAFLogo

mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
I am able to publish locally but when i try to send it to my application instance in the cloud I keep getting this message -



Any ideas?

Thanks
Sponsor

mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
Me again.  I have more information.  I was able to pull the following out of the application event logs from azures diagnostic tools -



Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 2/14/2022 6:28:13 AM

Event time (UTC): 2/14/2022 6:28:13 AM

Event ID: 0a15f89c7dbd4f92b7ac616f1b28c02e

Event sequence: 2

Event occurrence: 1

Event detail code: 0



Application information:

    Application domain: /LM/W3SVC/1837021746/ROOT-3-132892936932780239

    Trust level: Full

    Application Virtual Path: /

    Application Path: D:\home\site\wwwroot\

    Machine name: RD00155DF7C3EA



Process information:

    Process ID: 13360

    Process name: w3wp.exe

    Account name: IIS APPPOOL\homebrewforum



Exception information:

    Exception type: HttpException

    Exception message: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
   at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers)
   at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context)
   at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
   at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter..ctor()
   at System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor()
   at System.Net.Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters()
   at System.Web.Http.HttpConfiguration.DefaultFormatters(HttpConfiguration config)
   at System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection routes)
   at System.Web.Http.GlobalConfiguration.c.b__11_0()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at System.Web.Http.GlobalConfiguration.get_Configuration()
   at System.Web.Http.GlobalConfiguration.Configure(Action`1 configurationCallback)
   at YAF.Core.Context.YafHttpApplication.Application_Start(Object sender, EventArgs e)





Request information:

https://homebrewforum.azurewebsites.net:443/ 

    Request path: /

    User host address: 65.30.229.152

    User:

    Is authenticated: False

    Authentication Type:

    Thread account name: IIS APPPOOL\homebrewforum



Thread information:

    Thread ID: 26

    Thread account name: IIS APPPOOL\homebrewforum

    Is impersonating: False

    Stack trace:    at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
   at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers)
   at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context)
   at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
   at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)




Custom event details:





Does this help at all?

Thanks
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
Are you using the recommended.web.config? Looks like not. The assembly binding should Point to the correct newtonsoft.json.dll. Or the file is missing in the bin folder?!
mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
Yes, I am using the recommended.web.config renamed web.config.  Also the Newtonsoft.Json.dll is in the bin folder.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
Then the dependent assembly binding for that dll must have been removed or modified. Otherwise it would not try to load the wrong version.
mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
The only references I found from a find in files search are the following -

In the yaf.core.csproj file-

    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> 

and in the web.config file -

      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
      </dependentAssembly> 


This is really wierd.  6.0.0.0 isn't mentioned anywhere in the code and I literally nuked the entire bin folder to force the compiler to rebuild it from scratch.

Any other ideas?

 
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
I wonder if there is maybe another problem. If i access the site https://homebrewforum.azurewebsites.net  i get a Runtime Error. What error is displayed when custom errors is disabled in the web.config?

 <customErrors mode="Off"/>
mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
I replaced the custom errors line with the one you provided (copy & paste).  No change.  Same runtime error.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
If the errror message is the same then the web.config on the server is not updated. 
mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
Okay, I just published the app to a brand new empty instance of an app service on azure (https://homebrewtest.azurewebsites.net ).  The custom errors were set to off.  I am still getting the the same error.

How is that possible if the the only web.config file on the server was the azure default (if even that)?
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
a year ago
I don't know how the publish works. And which files are uploaded. Maybe the wrong file is uploaded?! I'm afraid but I can't help. 
mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
Well thanks for trying.  I appreciate it.

I'll have to ask some of the azure "experts" I know if they can help.

If I find anything useful I'll make sure to post it here.
mdavey
  • mdavey
  • 65.2% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 3.0.2
a year ago
Just an update.  I now have it working at  http://homebrewforum.azurewebsites.net/ .  I used the Sample Web app page in conjunction with the sqlserver source code and things worked much smoother.  Thanks to whoever built that.  It is actually more in line with what we're trying to do as it is integrated into an ASP.NET app.  So thanks again!!
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button