C# - Windows Phone 7 SDK - math class - c#

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

Related

Linphone.dll not found with windows form

I want to create a g application with C# and Windows Forms. For this I have downloaded and installed the latest nuget from the official website (https://download.linphone.org/releases/windows/sdk/). But now when I want to make a call, the programme crashes with the error:
DllNotFoundException:linphone.dll
I have now tried various things: modify LinphoneWrapper.cs, integrating dll file into the project, dll file in bin folder, ... but had no success.
I tried the same thing with C# UWP and it worked without any problems. But UWP does not look like the right way to me.
I am still inexperienced: Is it even possible with this nuget and Windows Forms, or do I have to download and build (cmake) the linphone-sdk first?
Thanks for help.
Are you building for x64? linphone doesn't support targeting x86 (look here)

Unable to load DLL 'sqlite3': in windows phone app.

I'm working on a windows Phone OLD application. I'm getting this issue related to SQL3.dll. in visual 2015.
Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
What I've tried, Done Cleaning all project, added sqlite.dll in Bin/debug folder, but I could not overcome this issue.
here is a screenshot.
I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible.
Any help would be appreciated.
Add the dll as a reference:
Right-click in "References" in the project you want to use it in and select "Add reference".
Select the option "Browse" and use the browse button to select the dll you want to include.
Add a using statement to the class.
After this you can use the dll in the project.
I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible.
SQlite is distributed as a VS extension. To add reference to your project, right click on References, “Add References”, “Windows Phone 8”, “Extensions”, check “SQLite for Windows Phone”, press OK.
No other steps are required, you don’t need other references and you don’t need to specify or deploy DLLs manually.
Also sqlite has different extension for WP8.1, you should probably install another one, sqlite-wp81-winrt-3220000.vsix.
Update: I think you’re trying to build for a platform that’s unsupported by SQLite library. SQlite for windows phone only supports 2 platforms, intel 32 bit (for emulators) and ARM (for devices and for the marketplace). It does not support AMD64, and it does not support “Any CPU”. You’re probably trying to build “Any CPU”, it’s usually the default platform for .NET.
Another possible reason is wrong project type. Your project has to be windows phone 8.1 app, not universal, i.e. the project name in the solution explorer panel must end with ”(Windows Phone 8.1)”
Update 2: I’ve compiled a simple app that uses sqlite, run it in emulator and it worked flawlessly on my PC. Ensure your references look like this:
If you have the same, make sure you have VS 2015 Update 3 installed. If you already have it, repairing your visual studio installation might help.

Convert folder of images to video using WP7+

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.

WinRT DLL created using Visual C++ doesn't load in a Windows Store app

I am writing a Windows 8 Store app using Visual Studio 2012. The main app is a XAML/C# app but it also uses a WinRT component written using C++/CX. For the WinRT component, I am using the VS project template called "DLL (Windows Store apps)" from the New Project dialog. Once I have this project, I change it to contain a single namespace with a single ref class. My C# project contains a reference to this C++ project.
However, when I try to run my app, the C# code throws an exception at the point it tries to instantiate/activate the C++ ref class. I have seen several working examples of this even on MSDN samples. I have verified that the WinRT component DLL and the winmd files are correctly copied into the final app package, and also that the app's AppxManifest.xml is properly updated with the correct registration information for the WinRT class. However it still fails.
I don't know what's going wrong. How can I fix this error?
Windows Runtime component binaries are required to have the following two exports:
DllCanUnloadNow
DllGetActivationFactory
When you use the VS project template "DLL (Windows Store apps)", your project doesn't define the requisite macro that causes the compiler to put the above two exports in the binary. Under project settings you will notice that the macro set is _WINDLL. You will need to change this to _WINRT_DLL.
Alternatively, the correct way to create a WinRT component using C++/CX is to use the VS project template called "Windows Runtime Component" under Visual C++ -> Windows Store. Using this will create a project which is already correctly setup with the right project settings etc. for creating proper WinRT binaries.

Windows Phone 7 and System.Xml.Linq library

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...

Categories

Resources