How to add reference to Windows.Networking in Windows Phone 8 - c#

I want to use DatagramSockets in a WP8 app to talk to an SSDP/UDP device (a Sony ActionCam) but I can't find the Windows.Networking DLL as it's not in any of the normal places you add references from. It does seem to live in various places on my Windows 8 machine but if I try to add it from somewhere like %Windows%/system32 it tells me it's not possible (which I guess because there's no Type Library?).
So can someone please tell me what I am missing? Is there some other SDK I need to download? I've looked all through the MSDN docs and though it mentions the namespace in plenty of detail it doesn't tell me how to find or add it for a WP8 app (typical MS).
Hope someone can help me - I'm clearly missing something obvious but I don't understand what or why.

Ok, I solved it - I have absolutely no idea why this was happening but it seems like VS2012 was the culprit. In desperation I saved the code I needed, deleted the entire solution and recreated it and now I can see the Windows namespace members.... bizarre! Also very, very annoying - I have wasted hours on this, apparently all because of some internal issue with VS2012.
Thanks for your input Tico, apologies if I wasted your time!

Just to follow up on this - I had the same issue. For me, I had to select .Net Framework 4.5 instead of 4.0. Creating a new solution in 4.0 within VS2012 wouldn't allow access to the Windows.Networking library. But 4.5 worked perfectly.

Just another idea of what might have gone wrong since i myself stumbled upon that mistake right now. Instead of a windows phone class library i added a portable class library (supporting windows phone 8 and windows store 8+ with .net 4.5). Seems like that combination doesn't support Windows.Networking

Related

HoloLens Networking Issues on Windows Holographic Version(21H1)?

Since a while I am working with HoloLens2. My last OS-Versions were 10.0.18362.1005 and 10.0.19041.1109. I am developing with Unity 2019.4.7. My whole code was and still is running great on those old OS-Versions. Now I updated to OS-Version 21H1 and I have huge problems with everything including networking.
For example, my Mixed-Reality-WebRTC Pluging (from Microsoft), which only supports ARM-Architecture, does not work anymore on my new Device. The app crashes after it was successfully starting.
Another thing is, that the DevicePortal does not transmit virtual inputs. Again, on my older HoloLens2´s Virtual Input works great.
Also, even if I disable WebRTC parts of my Project, I still get an Exceptions in my Networking-System which I can´t assign to any cause. In term it is useful for you, I work with windows.Networking Library and in special with DatagramSocket.
I would be really glad if anybody could help me with this. Is OS-Version 21H1 restricted to any specific Unity- or VisualStudio Version (here currently I use 16.4.5)? Or is it Restricted to specific Networking Libraries? Thanks in advance!
Now I was able to fix the Networking Exception. The reason for that is located within my UDP-Communicator which uses DatagramSocket. Since earlier .Net.Sockets was not available at HoloLens2, now it is and I coincidentally came across this information. So I switched my implementation to .Net.Sockets which already exists in my project for editor-usage and now basic networking works fine.
Also, I was able to make WebRTC work again. With one of my Provisioning-Packages I disabled the usage of microphone for mixedReality and it seems like access to those audio-informations is mandatory for MR-WebRTC.
Unfortunately, I still have the same issues with Device Portal.This really looks like a bug.

WP Silverlight 8.1 App - Reminder not launching app when touched

Im having problems getting the Reminder notification to launch my App once it's touched. Through the MSDN step by step guide and documentation found HERE, I know that, if the user does not touch any of the buttons (snooze/decline) but touches the popup itself, the Uri defined in the reminder should be opened inside the App. However, once I do that, not even the App itself is launched, let alone the specified Uri.
To make sure the problem wasn't on my App, I've created a new application and copied the exact code found on the page linked above, and while it does schedule a Reminder, once it pops up, touching it only makes it disappear, still not launching the App nor the specified Uri (which exists, yes).
I've already searched a bit around here, and even though I've found a couple of questions similar to what I'm asking (such as this one), it relates to WP 7, while Im having problems with WP 8.1.
The user in the previously mentioned question figured out by himself that one needs to have the app closed for the popup to launch it at the specified Uri. However, even doing so, nothing happens with me, both on the emulator and the device. I have even removed it from the suspended/previously used apps, but still nothing happens.
I have also found this, but nobody answered, and I don't have enough rep to comment on his question asking if he found the solution :/
I'm using VS 2013 Professional Update 3, Windows 8.1 Pro 64 bits, The Windows Phone 8.1 SDK and Emulator and a Nokia Lumia 620 with Windows Phone 8.1 on it. My apps are Windows Phone Silverlight 8.1. If anyone wants, I can link to the binaries for the test app I've built, but it's really a copy & paste from the tutorial from the first link I mentioned.
If anyone could help me on this, I'd reeeeally appreciate, because I feel like I'm missing something really small and stupid, but can't figure out what. Other than that, it just seems like a bug on WP 8.1.
Thanks in advance, and sorry if it's an already solved question, but as you can see, I tried to find the answers and couldnt...
Just wanted to say, to whoever finds him/herself struggling with this problem, that I - sort of - solved this problem.
I got in touch with a Microsoft Developer Evangelist who told me that indeed, this feature was removed from the 8.1 API. He refused to admit it was simply a bug, even though he agrees on that fact that the "Uri" property still being there is confusing. I'm not sure whether to believe him or not on this matter (I still think it's a bug), but at least I found out the problem was not me.
In the end, the only viable solution was to convert the whole project back to WP 8.0. Since Visual Studio does not allow one to do it by simply editting the project file, I had to copy all files to a new project by hand. Luckily, there were no major issues while doing so. Now the "go to URI" behaviour works just fine!
Hope it helps someone :)

Adding task options when pinned app is right clicked

We have a c# application that requires a few steps be completed before every launch. I wrote a c# app to automate these steps.
Can anyone help me figure out how I can [EDIT: configure a JumpList] for my app?
I have included a screen capture to hopefully get my point across as I'm not sure how to explain it any better.
For the native interfaces, see Taskbar Extensions (Windows). Specifically, I think you're looking for the ICustomDestinationList::AddUserTasks method.
If you're using .Net 4+, you can now do a lot of this stuff with built-in classes in the System.Windows.Shell namespace, rather than adding the Windows API Code Pack as suggested by Coding Gorilla. See for example System.Windows.Shell namespace
Those are called "Jump Lists", have a look at the Windows API Code Pack here. I can't tell you exactly how to implement them, because it's very dependent on your application code. But this should give you somewhere to start.

C# Joystick Input

I've got a Logitech Attack 3 (Standard Joystick) plugged into my computer and have confirmed that it is working. Now given that, I need a way via C# (only C#) to read the axis (and buttons would be nice too) values from the joystick. I have seen many examples which use DirectX, but are from 8 years ago and no longer work with .NET 4.5...Hence, I need a .NET 4.5 solution that works on Visual Studio 2012. I have done extensive research on this and cannot find a way to get simple coordinates from a joystick. Any help would be appreciated. Thanks!
I have tried to use SlimDx, but have no idea what code to write.
Also, this: http://www.codeproject.com/KB/directx/joystick.aspx <-- this is from 2006, and no longer works with .NET 4.5 for some reason.
Those examples you've looked at should still be fairly correct. What has changed is the directX version and I think you should have a look at directX11 to use in your project.

.net 3.5 windows form application, using webcam

Having searched high and low for native c# hook to webcam, I found 5 basic ways to interact with the camera.
Video for Windows (VFW)
DirectX
avicap32.dll
WIA
3rd party tools
My requirement is to take a photo. The application will be used on some legacy windows XP and Vista machines, but going forward Windows 7 and greater will be required. So what might the best approach be with the broad install base? Just reading WIA looked like the way to go but looks like some changes were made so it works a little different now (I don't know for sure). I understand that some people have done combos.
Might need to crop photo, but that is really about it.
For school visitor monitoring.
I think the best thing is to use the WIA. I know a third party toolkit that could help you doing your requirements which is leadtools. You can check this Tutorial
I would always try to pick up something already on the web and tweak it to my own needs... some open source project or an example where the mainly portion of my app is already made.
on Codeplex you can find a nice library to work with webcams and it's simply called
WebCam Library for WinForm and WPF with C# and VB.NET
Give that a try, maybe you can even help the project, by contributing your own findings, and everyone is a winner... isn't Open Source a great idea?!

Categories

Resources