I'm trying to follow this tutorial about WP7 development: http://mobile.tutsplus.com/tutorials/windows/introduction-to-windows-mobile-7-development/
It's talking about using XElements, which require the System.Xml.Linq library, but I can't find a way to add it to the project references. When I go to add reference, the .NET list is empty, and it's saying it's filtered to Windows Phone 7.
The tutorial might be out of date. Is the library even available for WP7? Is there a different way to read XML on the platform?
How can I get it working?
EDIT:
The same problem is described here:
http://forums.netduino.com/index.php?/topic/1127-add-reference-net-tab-empty/
The suggested fix doesn't work for me.
EDIT:
Apparently this is a bug in the Silverlight 4 Tools:
https://connect.microsoft.com/VisualStudio/feedback/details/529718/empty-net-tab-when-adding-a-reference
That is the correct Assembly you need to work with XML in Windows Phone 7. Not sure why it does not show up in your Add Reference dialog.
It should be like following:
What version of WP7 developer tools are you using?
The assembly list should not be empty when adding a reference from the .NET tab even for a Windows Phone 7 project, so it sounds like you might have an issue with Visual Studio.
However, you could try using the Browse tab instead. On my system (64-bit), the assembly is in the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone folder.
Yes, LINQ to XML is definitely available for Windows Phone 7. If you aren't seeing any available references to add, that sounds like your development environment is a little bit messed up...
Related
I need to use Windows.Storage.Streams and Windows.Devices.Enumeration in my Winforms application on Windows 7 to access and manipulate Barcode reader, but unable to find it to Add Reference. Not sure if can download it somewhere. I was able to find and download Microsoft.PointOfService and added reference to my project, but not the first two libraries.
Please advise.
The Windows.Storage.Streams and Windows.Devices.Enumeration namespaces are part of the Windows Runtime. To use them you need to target Windows 8 or above. They aren't available when targeting Windows 7.
How to access the Windows 10 APIs from WPF
You can access the Windows 10 APIs from a pre-existing WPF project. To do so, go to your Solution Explorer window and …
Right click on References.
Select “Add Reference…” from the context menu.
On the left of the Reference Manager, choose Browse and find the following file: C:/Program Files (x86)/Windows Kits/10/UnionMetadata/Windows.winmd.
Add it to your project as a reference. Note: You will need to change the filter to “All Files”.
Right click on References. Select “Add Reference…” from the context menu. On the left of the Reference Manager, go to Browse and find the directory “C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETCore/v4.5”. Add System.Runtime.WindowsRuntime.dll to your project.
Learn More Calling Windows 10 APIs From a Desktop Application
Just to be helpful to others that arrive here through Google, Microsoft has some NuGet packages to access Windows-specific APIs like that without the need to import or reference Windows libs manually. More info can be seen on their documentation here.
For those trying to use it from Windows 8/8.1, add a reference (like Sajeeb's answer) to the files at 32-bit C:\Windows\System32\WinMetadata or 64-bit C:\Windows\System32\WinMetadata respectively.
I believe those namespaces are not part of Windows Apps libraries. I don't think a WinForm project is able to use them. Personally, I don't have newer versions of VS, so I am not sure of that. But there is supposed to be a new project type in VS2015 onwards.
I'm very new to Xamarin. I have a few published Windows Store apps and want to convert them to Android. I'm attempting to use Xamarin for this. I'm just using the free version of Xamarin. Here's where I am so far:
I am trying two apps - one was build with Monogame and one is just build on the WinRT framework.
I have managed to get them both into Xamarin studio, basically by hacking the csproj files.
I'm getting build errors because it's missing references. There does appear to be some equivalent Mono / .Net4 libraries, but things like Storage seem to be missing.
So, my question is: am I going about this the right way and, if so, am I missing a step ("convert dependencies" or something)?
If I'm not going about this the right way then how should I be doing this (I found very few online resources on this subject)?
EDIT:
The following are some specific errors that I'm getting from the Xamarin App:
And my references:
EDIT:
After some further research, the only dependency I can't explain as missing is Microsoft.Xna.*. The others all have different implementations on Android / iOS.
You will be able to use much of your existing code with Xamarin.
However, the errors you are getting with those specific libraries are because they do not exist for Xamarin in iOS and Android. So whatever functionality you had you will need to rework using libraries that are available.
For example, instead of using Windows.Storage you would use Android.OS.Storage.
See their documentation for details:
http://androidapi.xamarin.com/index.aspx?link=N%3AAndroid.OS.Storage
Edit
For XNA all of that should port fine if you use MonoGame:
https://github.com/mono/MonoGame/wiki
I'm not sure why it's not bundled in Xamarin, but that will hook you up.
Edit
This is taken from Xamarin documentation found here: http://developer.xamarin.com/guides/cross-platform/cocos2d_xna/cocos2dxna_tutorial/
After creating the project, you need to add the various Cocos2D-XNA dependencies to the solution. Add the following projects from the location where you downloaded the Cocos2D-XNA and MonoGame source:
box2d.iOS – 2D physics library. We’ll use this in later tutorials.
cocos2d.iOS – Cocos2D-XNA for iOS.
Lidgren.Network.iOS – Networking library used by MonoGame.
MonoGame.Framework.iOS – MonoGame for iOS.
This video may answer your question. You will most likely need to replace the reference with a PCL equivalent if one exists.
http://developer.xamarin.com/videos/cross-platform/any/
i am having a bit of a problem with a dockpanel, that being I cannot get it to work.
I have installed the toolkit for silverlight 4, as shown in this link:
http://procbits.com/2011/07/19/missing-dockpanel-add-dockpanel-for-silverlight-4-or-silverlight-5
but i have no suck luck in getting it to work, it says : "the type 'tk:Dockpanel' was not found'
Any help on this would be great
Add this dll manually to the references,
System.Windows.Controls.Toolkit
also, define the namespace like this
xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
If its a windows phone you need to install the version of silverlight supporting windows phone.
I am trying to use Slicer dll reference to convert images to a video file, but I am having a problem with adding the reference to my Windows Phone project, I get the error
Reference cannot be added to l because it was not built using the Windows Phone runtime. Windows Phone projects will work only with Windows Phone assemblies.
I searched and found this link where it's mentioned to
Create a new class library for Silverlight for Windows Phone 7
I don't know if I am creating the class project right but it's not working I get the same errors as with the win phone project, can't install .dll, does anyone know how I can create the class library correctly without this error?
Or even if it is possible to use Splicer with windows phone 7 & 8?
Thanks for your help.
As far as I know, Splicer isn't built to work on Windows Phone. While it seems like it would make sense that general .NET libraries would work on a .NET compatible platform like WP7 and WP8, that's not necessarily the case. (a little outdated, but here: http://dotnet.dzone.com/articles/not-every-library-will-work)
You could always check out Splicer from Codeplex, but you'd probably have to do a non-trivial amount of modification to get it to work for your project. I'd surmise you could maybe pull it off by just modifying the class libraries in the solution, but there are probably pitfalls included with that. Worse comes to worse, you could take all the source files, copy them into a new Windows Phone library project, and then resolve all the build errors. Either way, it'll involve some work.
It seems that I cant use system.math class within the windows phone projects. I can't even add the mscorelib.dll manually (windows phone dlls are different than windows dlls)
Is there any way to use System.Math class within the windows phone SDK projects?
I've just tried and it works fine for me. I didn't need to do anything special or add any references, just the normal using System; and then (say):
decimal m = 10.6m;
m = Math.Round(m);
What happens when you try that?
You get the Silverlight (Windows Phone version) CLR, so trying to add mscorlib from the normal CLR won't work - you need the mscorlib.dll specific to that CLR as the assembly structure is different.
It's inside my mscorlib however, have you tried re-adding the reference, or closing Visual Studio?
Try manually editing the .csproj file . It happens when you try to open projects that were built on nonbeta builds on a machine with beta build of the SDK.
Try adding this to the project file