Below I have pasted some code. On the first line of the body I call an awaitable call Task<IEnumerable<SkuGcn>> GetSkuGcnList();
On the last line, in the mapPromise.GetAwaiter()
it throws when getting the result with this exception:
An exception of type 'System.IO.FileNotFoundException' occurred in System.Private.CoreLib.ni.dll but was not handled in user code
Additional information: Could not load file or assembly 'System.Runtime.Serialization.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
I know my service that the GetSkuGcnList()
call is calling to, is being called, because I can set a break point and I break at it when the call is made. Then the service seems to return.
This code worked just fine with ASP.NET 5 RC1 but now not so good in ASP.Net Core 1.0 Release.
Any help will be greatly appreciated!
public ProductItemsCacheStore(IItemsProductCacheRepository itemsRepo, IProductAvailabilityPricing proxyGoliathApi,
IProductItemListRepo itemsListsRepo, IItemPricesCacheRepo itemPricesRepo)
{
var mapPromise = proxyGoliathApi.GetSkuGcnList();
_items = itemsRepo.GetAllProductOrderListForCache();
_itemsLists = itemsListsRepo.GetItemListsForCache();
_priceZones = itemPricesRepo.GetAllPriceZonesAndItemPrices();
MergeProductsWithGcn(_items, mapPromise.GetAwaiter().GetResult());
}
My project.json looks like this:
{
"version": "1.0.0-alpha.1",
"description": "AvailabilityPricingClient Class Library",
"authors": [ "irving.lennert" ],
"packOptions": {
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": ""
},
"tooling": {
"defaultNamespace": "AvailabilityPricingClient"
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.AspNet.WebApi.Client": "5.2.3"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
}
}
The implementation of GetSkuGcnList()
is this:
public async Task<IEnumerable<SkuGcn>> GetSkuGcnList()
{
HttpResponseMessage response = _client.GetAsync("/api/skuGcnList").Result;
if (response.IsSuccessStatusCode)
{
var skuGcns = await response.Content.ReadAsAsync<IEnumerable<SkuGcn>>();
return skuGcns;
}
return null;
}