That assembly does not allow partially trusted callers
Both apps reside on the same shared hosting environment and domain. That is, both app's have the same domain but are in different folders (i.e. applications) in IIS. For instance, mywebsite.com/folder1 and mywebsite.com/folder2.
Here's a sample how asp.net web app calls the .net core web api:
oRequest = HttpWebRequest.Create("https://www.mywebsite.com/folder2/path/to/api") With oRequest .Method = "GET" .ContentType = "application/x-www-form-urlencoded" .Accept = "application/json" .ContentLength = 0 oResponse = oRequest.GetResponse() oReader = New StreamReader(oResponse.GetResponseStream) 'store results in string sResult = oReader.ReadToEnd End With
We checked the .NET trust level and both app's are set to "Full (Internal)". Also, we tried adding the AllowPartiallyTrustedCallers attribute to the controller but per MS, "Partially trusted code is no longer supported. This attribute has no effect in .NET Core."
Is there another way to call the api?
Help is appreciated.