I am using .Net framework 4.5.1 System.Web.Http : 5.2.3.0
I have existing API call i need to add multiple e.g. [EnableCors(origins: "http://example.com", headers: "accept,content-type,origin,x-my-header", methods: "*")]
reference link : https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-3.1
After installation System.Web.Http.Cors
getting below error message Server Error in '/' Application. Could not load file or assembly 'System.Web.Http.Cors, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Http.Cors, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Http.Cors, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
Please suggest me. Thanks,
Aucun commentaire:
Enregistrer un commentaire