Windows phone app - live tile https issue - windows-phone-7

Recently I updated the scheme from http to https in my window phone app. So far network request works fine.
However, the live tile is not working anymore.
Then I tried to debug and found that:
System.ArgumentException occurred at Microsoft.Phone.TaskModel.Interop.ApplicationHost.GetFileSystemPath(String uri)
Also:
System.Reflection.TargetInvocationException occurred Message:
A first chance exception of type
'System.Reflection.TargetInvocationException'
occurred in mscorlib.ni.dll
Additional information: Exception has been thrown by the target of an
invocation.
Finally:
at Microsoft.Phone.TaskModel.Interop.ApplicationHost.GetFileSystemPath(String uri)
at Microsoft.Phone.Shell.ShellTileData.GetLocalFilePath(Uri imageUri)
at Microsoft.Phone.Shell.UriToLocalStoreConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
at Microsoft.Phone.Shell.ShellTileData.SerializeToToken(IPMTileInfo token)
at Microsoft.Phone.Shell.ShellTile.Update(ShellTileData data)
at AlarmScheduledTaskAgent.ScheduledAgentSettings.updateLiveTileUI()
I know the issue comes from the URI image for liveTile because if I change back to http liveTile is loading the image correctly. Also I tried to use another http image it doesn't crash. But if I use another https image online it crashes.
Although I didn't find anything indicating liveTile doesn't support https, anyone knows how to fix the issue? Thanks!

Related

Flutter/Dart - exception on URL that doesn't Exist anywhere in the project?

I'm using Android Studio and getting an error on a NetworkImage url which doesn't exist anywhere in the project. I've done a "Find in Path" (control shift F) from the top of the project and the URL doesn't appear anywhere. I'm utterly baffled. I recognize the URL from a site which I migrated away from. But I've replaced every single URL in the project so I don't know where it's coming from. Where could it be?
════════ Exception caught by image resource service ════════════════════════════════════════════════
The following SocketException was thrown resolving an image codec:
Failed host lookup: 'app.myurl.com' (OS Error: No address associated with hostname, errno = 7)
When the exception was thrown, this was the stack:
Image provider: NetworkImage("https://app.myurl.com/63-user.jpg?v=1603283280800", scale: 1.0)
Image key: NetworkImage("https://app.myurl.com/63-user.jpg?v=1603283280800", scale: 1.0)
Try flutter clean to clean the build cache.

HttpListenerContext.AcceptWebSocketAsync error 1229

I'm trying to add a WebSocket to existing code which handles HTTP requests. Not using IIS or ASP.NET, just C# code with an HttpListener. When the client sends the upgrade request, the server bombs:
System.Net.WebSockets.WebSocketException was unhandled by user code
ErrorCode=1229
HResult=-2147467259
Message=An error occurred when sending the WebSocket HTTP upgrade response during the AcceptWebSocketAsync operation. The HRESULT returned is '1229'
NativeErrorCode=1229
Source=System
StackTrace:
at System.Net.WebSockets.WebSocketHelpers.<AcceptWebSocketAsyncCore>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at mycode.<mymethod>d__46.MoveNext()
InnerException:
Calling code:
HttpListenerContext context = listener.GetContext();
if (context.Request.IsWebSocketRequest)
{
HttpListenerWebSocketContext wsContext = await context.AcceptWebSocketAsync(null);
I find the MS documentation on the entire WebSockets namespace to be useless with no code examples. I don't know what it's trying to tell me here (other than the obvious fact that I'm not handling the exception - I want to know why there is an exception in the first place).
This is Windows 10, .NET framework 4.5. I have noticed places in the documentation which say that WebSockets only works with Windows 8 and 2012, but I assume it should work with 10 too.
Had to go to Windows Features, under IIS (even though I'm not using IIS), and turn on WebSocket Protocol. I don't know whether this being off is Win10 default or just due to the image IT installed for me.

HttpClient->GetStringAsync() throws 0x000006F4 for https Uris

The code below works fine for me if I use an http URI, but fails for equivalent https alternative. It works fine when built and run on another machine or when I include it in another app.
GetStringAsync throws an exception: “Exception thrown at 0x770B5722 (KernelBase.dll) in .exe: 0x000006F4: A null reference pointer was passed to the stub. occurred”.
ThreadPool::RunAsync(ref new WorkItemHandler([this](IAsyncAction^ action)
{
HttpClient^ client = ref new HttpClient();
auto uri = ref new Uri(L"https://....");
auto t = create_task(client->GetStringAsync(uri));
t.then([](String^ response)
{
// response should be valid.
});
}));
Running netsh winsock reset to reset the network stack seems to fix the issue!
For me, network stack reset didn't help at all, even device reboot didn't help, but your own answer have pointed me in the right direction: it wasn't my code who suddendly went mad, it was Windows. So what actually helped in my case is starting app without debugger (that is, from Start menu) - after that app continues to work fine when started from Visual Studio. It have happened a few times now, and I can confirm that it always helps.

Nuget.Server on Mac OSX

I followed this steps to setup my own nuget server on local machine (Mac)
https://learn.microsoft.com/en-us/nuget/hosting-packages/nuget-server
I got to step 6 and then when i click "here" it gives me the following error
System.Web.HttpException
The resource cannot be found.
Description: HTTP 404.The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Details: Requested URL: /nuget/Packages
Exception stack trace:
at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext context) [0x00094] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/StaticFileHandler.cs:77
at System.Web.DefaultHttpHandler.BeginProcessRequest (System.Web.HttpContext context, System.AsyncCallback callback, System.Object state) [0x0007f] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/DefaultHttpHandler.cs:101
at System.Web.HttpApplication+<Pipeline>d__225.MoveNext () [0x008d4] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/HttpApplication.cs:1335
at System.Web.HttpApplication.Tick () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/HttpApplication.cs:927
Please help
I can see two issues in this approach.
Nuget.Server documentation mentions IIS as the web sever; IIS doesn't run on Mac OSX.
And, even if you end up using the native web server of your operating system, you will need WCF support in mono - which looks to be a work in progress.

Properly Establishing an ApplicationEndpoint in UCMA 3.0

I've been struggling with getting an application endpoint working on UCMA 3.0. I am trying to run an application on a server separate from the Lync server which uses a registered ApplicationEndpoint to monitor presence and act as a bot which can send other users messages. I used to have my code working with a UserEndpoint (which was fine for monitoring presence), but did not have the capabilities to send IMs to other Lync users.
After searching the web, I'm finally at the point where I'm getting this error when running my code:
System.ArgumentException was unhandled
Message=An ApplicationEndpoint can be registered only if proxy and Multual Tls have been specified.
Source=Microsoft.Rtc.Collaboration
StackTrace:
at Microsoft.Rtc.Collaboration.ApplicationEndpoint..ctor(CollaborationPlatform platform, ApplicationEndpointSettings settings)
at Waldo.endpointHelper.CreateApplicationEndpoint(ApplicationEndpointSettings applicationEndpointSettings) in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\endpointHelper.cs:line 117
at Waldo.endpointHelper.CreateEstablishedApplicationEndpoint(String endpointFriendlyName) in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\endpointHelper.cs:line 228
at Waldo.waldoGrabPresence.Run() in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\waldoGrabPresence.cs:line 60
at Waldo.waldoGrabPresence.Main(String[] args) in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\waldoGrabPresence.cs:line 42
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
After some searching, I followed the instructions here: http://blogs.claritycon.com/blogs/michael_greenlee/archive/2009/03/21/installing-a-certificate-for-ucma-v2-0-applications.aspx to import a certificate onto the server that I'm trying to run the application on, but to no avail.
So at this point, I think that there must be something wrong with how I'm setting up the ApplicationEndpointSettings, CollaberationPlatform or ApplicationEndpoint objects. Here's how I'm doing it:
ApplicationEndpointSettings settings = new ApplicationEndpointSettings(_ownerURIPrompt, _serverFQDNPrompt, _trustedPortPrompt);
ServerPlatformSettings settings = new ServerPlatformSettings(null, _serverFQDNPrompt, _trustedPortPrompt, _trustedApplicationGRUU);
_collabPlatform = new CollaborationPlatform(settings);
_applicationEndpoint = new ApplicationEndpoint(_collabPlatform, applicationEndpointSettings);
Does anyone see any problems with what I'm doing? Or, better yet, does anyone know of a blog that walks you through establishing an application endpoint in the situation I'm in? I work really well with tutorials or samples, but have not found one that seems to accomplish what I'm trying to do.
Thanks for the help!
The procedure to get a certificate in Lync is very different than OCS2007, and much easier. The link you posted is for UCMA2, and OCS, I believe. In Lync, it's basically two powershell statements.
1) Request-CSCertificate -Action new -Type default -CA -Verbose
2) Save the results of that statement, take the thumbprint, use it as the parameter to:
Set-CsCertificate -Type Default -Thumbprint XXXXXXXXXXXXXXXXXXXX
Installing UCMA 3.0 and Creating a Lync Server 2010 Trusted Application Pool
use powershell to provision a trusted application endpoint. The command to explore is new-trustedapplicationendpoint. The error you are getting is due to no trusted endpoint being registered, even though you may have your trusted application registered, it needs an endpoint to work and that endpoint must be first registered before you provision the platform.
The SDK CHM file should be your friend here! This section is about app activation and provisioning
Pass the certificate to the ServerPlatformSettings object, then it works. I had the similar problem, and the problem is resolved after using the ServerPlatformSettings(string applicationUserAgent, string localhost, int port, string gruu, string certificateIssuerName, byte[] certificateSerialNumber) constructor for the ServerPlatformSettings.

Resources