I built a simple IoT UWP app containing 1 button and 1 text field.
Pushing the button shall call a function from the WCF service and display the result inside the text field.
I designed my app
In the same VS project I created a new WCF application with the default functions inside
I added the WCF application as a service reference.
After compiling the UWP app I runs without issues.
As soon as I push the button, I get the following error messages:
Exception thrown: 'System.Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.ServiceModel.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.ServiceModel.CommunicationException' in System.Private.ServiceModel.dll
Exception thrown: 'System.ServiceModel.CommunicationException' in System.Private.CoreLib.dll
Exception thrown: 'System.ServiceModel.CommunicationException' in System.Private.CoreLib.dll
Exception thrown: 'System.ServiceModel.CommunicationException' in System.Private.ServiceModel.dll
Exception thrown: 'System.ServiceModel.CommunicationException' in System.Private.CoreLib.dll
An exception of type 'System.ServiceModel.CommunicationException' occurred in System.Private.CoreLib.dll but was not handled in user code
Additional information: net_http_client_execution_error
The event handler for the button in my UWP looks as follows:
private async void button_GetData_Click(object sender, RoutedEventArgs e)
{
Service1Client cl = new Service1Client();
await cl.OpenAsync();
var res = await cl.GetDataAsync(12);
txtData.Text += res;
}
My service looks as follows:
using System;
namespace WCF_Temp
{
public class Service1 : IService1
{
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
}
I ran out of ideas... Is anyone having the same trouble?
Thanks in advance!
}
Your code was simple in your WCF, and your client code also was simple. So, it's hard to locate your issue if just checking your code snippet.
You might need to do troubleshooting. For example,
You could add some break points in your WCF and client code to debug.
You could input your WCF service address in your favorite browser to test if your service work. If it worked well in browser, you might need to check if you have add reference to your WCF services correctlly in your UWP client.
You could use fiddler to capture traffic and check if the request has been sent successfully.
In addition, if you don't know how to debug WCF service, please check this document Debugging WCF Services
Related
My UWP app crashes on Xamarin.Forms.Forms.Init(e, assemblies) with
**Exception thrown:
'System.IO.FileNotFoundException' in
System.Private.Reflection.Core.dllFileNotFound_AssemblyNotFound,
clrcompression**
The app don't crash if I uncheck 'System.IO.FileNotFoundException' from Exception settings, but it's not the best solution because if I uncheck this exception I have another problem with Storage API(I can't use the StorageFolder to get files because the execution doesn't return and no exception is thrown).
I don't know if this problem can be releated with the first exception, but
can anyone fix this problem?
The problem was async/await method when I use Storage API, and for System.IO.FileNotFoundException I had to update Visual Studio.
We have a Windows 10 UWP app that runs fine under Debug builds and crashes under Release builds. What it is about release builds that makes it crash is that .NET Native tools chain is enabled - disabling that allows the app to run. But that's not a real fix as it needs to run with .NET Native tool chain if you intend to publish to the store.
We use Microsoft.Practices.Unity for DI. Here's an example of how we register some classes:
container.RegisterType<IBoardView, BoardView>();
And then, in our app we resolve it as follows:
container.Resolve<IBoardView>();
It works fine unless I run it with .NET Native, in which case I get the following exception:
An exception of type 'Microsoft.Practices.Unity.ResolutionFailedException' occurred in Microsoft.Practices.Unity.dll but was not handled in user code
Additional information: Resolution of the dependency failed, type = "WindowsUniversal.ViewModels.Interfaces.IBoardViewModel", name = "(none)".
Exception occurred while: while resolving.
And in the output window I get:
Exception thrown: 'System.NullReferenceException' in System.Linq.Expressions.dll
Exception thrown: 'System.NullReferenceException' in Microsoft.Practices.Unity.dll
Exception thrown: 'Microsoft.Practices.Unity.ResolutionFailedException' in Microsoft.Practices.Unity.dll
An exception of type 'Microsoft.Practices.Unity.ResolutionFailedException' occurred in Microsoft.Practices.Unity.dll but was not handled in user code
Additional information: Resolution of the dependency failed, type = "WindowsUniversal.ViewModels.Interfaces.IBoardViewModel", name = "(none)".
Exception occurred while: while resolving.
Exception is: NullReferenceException - Object reference not set to an instance of an object.
At the time of the exception, the container was:
Resolving WindowsUniversal.ViewModels.Interfaces.IBoardViewModel,(none)
All this works under Debug or Release when .NET Native is disabled. Now I know .NET Native has it's limitations, reflection being one of them. I guess I'm asking how to get around this?
Any insights would be greatly appreciated, thanks.
I have trouble running unit test on one of my machine, the test app just shut down after few seconds. Here is the output show when debugging the test:
Exception thrown at 0x7525D8A8 in UnitTestProject1.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0A17C5F0.
Exception thrown at 0x7525D8A8 in UnitTestProject1.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x7525D8A8 (KernelBase.dll) in UnitTestProject1.exe: 0x40080201: WinRT originate error (parameters: 0x8007274C, 0x000000B9, 0x0EE4F6AC).
Exception thrown: 'System.Exception' in mscorlib.ni.dll
WinRT information: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Exception thrown: 'System.Net.Sockets.SocketException' in System.Private.ServiceModel.dll
Exception thrown: 'System.Net.Sockets.SocketException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in System.Private.ServiceModel.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.ServiceModel.EndpointNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in mscorlib.ni.dll
Those exceptions is not related to my app at all, as my app dont need internet and the code in test method is not reached. They are from the test framework.
The same solution run test fine on every other machine (same Windows 10 build). I think the problem is that the system on troubled machine turn off some services required for unit testing. I cant find any thing related anywhere. What should I do to fix that, I dont want to re-install Windows.
Seems like the connection with the Test Emulator can't be established. When you build the TestApp make sure that you have set the Build configuration to Debug - Any CPU (not ARM)
Also, you shouldn't run the test project by hitting F5 but run the tests from the TestExplorer.
I end up reinstall VS 2015 and the problem now gone.
I'm trying to download a simple XML file that I have in Azure Blob Storage for my WP8.1 Silverlight App. It doesn't work on my old beat-up Lumia 520 though. It works on every other phone and emulator I've tried though. Here's the line of code where it fails:
myXmlDoc.LoadXml(await myBlobStorageAccount.CreateCloudBlobClient().GetContainerReference("tileinfo").GetBlockBlobReference("test.xml").DownloadTextAsync());
And here are the errors:
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.Net.WebException' in System.Windows.ni.dll
Exception thrown: 'System.Net.WebException' in System.Windows.ni.dll
Exception thrown: 'System.Net.WebException' in Microsoft.WindowsAzure.Storage.ni.DLL
Exception thrown: 'Microsoft.WindowsAzure.Storage.StorageException' in Microsoft.WindowsAzure.Storage.ni.DLL
Exception thrown: 'Microsoft.WindowsAzure.Storage.StorageException' in Microsoft.WindowsAzure.Storage.ni.DLL
Exception thrown: 'Microsoft.WindowsAzure.Storage.StorageException' in mscorlib.ni.dll
Anyone know what is going on here? The Phone is running 8.10.12400.899.
I am using sample from https://github.com/liveservices/LiveSDK but it isn't working. I managed to run the PhotoSkyOnTheGo project, but after logging in I get 3 exceptions:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
What am I doing wrong or what source code should I use?
Try to change Mobile client app setting to yes in manage.dev.live.com inMy applications > yourApp > API Settings tab