Error creating FlipView control in Windows Phone 8 SDK - windows-phone-8

When i create control As FlipView control is not available in Windows Phone 8 SDK
i get the following error
Error 1 Xap packaging failed. Cannot access a closed Stream.
Error 2 The type FlipViewControl:FlipView was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
Error 3 The attachable property 'ItemTemplate' was not found in type FlipView.
Here is code:
<Grid x:Name="FlipImage" Grid.Row="1">
<FlipViewControl:FlipView Name="imgViewer">
<FlipViewControl:FlipView.ItemTemplate>
<DataTemplate>
<Image Source="{Binding}" Stretch="Fill"/>
</DataTemplate>
</FlipViewControl:FlipView.ItemTemplate>
</FlipViewControl:FlipView>
</Grid>
In Header xmlns:FlipViewControl="clr-namespace:TruyenMoi"
I have a error Error 1 Xap packaging failed. Cannot access a closed Stream. I don't understand it.

Related

Lumia Imaging SDK throws System.TypeLoadException: Lumia.Imaging.StorageFileImageSource is not registered

I've used Lumia Imaging SDK (ver 2) for compressing images in my Windows Phone 8.1 RT application. The code for compression randomly throws the following exception:
System.TypeLoadException: Failure has occurred while loading a type.
Requested Windows Runtime type 'Lumia.Imaging.StorageFileImageSource' is not registered.,
Message: Failure has occurred while loading a type.,
Stacktrace: at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at Lumia.Imaging.StorageFileImageSource..ctor(IStorageFile storageFile)
How can I fix this?
Update: I'm using Visual Studio 2013 Update 5. Details .

Windows phone manifest error when trying to change manifest

I have the following error when I try to modify the manifest file of my windows phone 8 app:
Error 1 The 'ConsumerID' attribute is invalid - The value '{DFF24-AA15-4A96-8006-2BFF8122084F}' is invalid according to its datatype 'http:// WPCommontypes:ST_Guid' - The Pattern constraint failed.
Am just trying to change the lockscreen image from my app, so I just added this line under <Tokens> in the manifest:
<Extensions>
<Extension ExtensionName="LockScreenImage" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" TaskID="_default"/>
</Extensions>
Are you using LockScreen_Background as your ExtensionName or just LockScreen? You should be using LockScreen_Background.

fragment support compilation errors

I have an Android app which uses:
ActionBarSherlock Xamarin component
MvvmCross fragment support.
I just upgraded to MvvmCross 3.1.1 and I get some errors:
Error 2 The type 'Android.Support.V4.App.Fragment' is defined in an assembly that is not referenced. You must add a reference to assembly 'Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Error 3 The type 'Android.Support.V4.App.FragmentActivity' is defined in an assembly that is not referenced. You must add a reference to assembly 'Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
I delete bin and obj folders just to be sure and rebuilt, same errors.
If I add the Android Support Library v4 Xamarin component, I get a many errors like
Error 11 The type 'Android.Support.V4.App.ActionBarDrawerToggle'
exists in both 'c:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v4.3\Mono.Android.Support.v4.dll'
and
'..\xamandroidsupportv4-18-4.18.1\lib\android\Xamarin.Android.Support.v4.dll'
..MyActionBarDrawerToggle.cs 19 44
If I remove the Mono.Android.Support.v4 I got error which asks me to put it back.
It seems you have an old version of ActionBar Sherlock component that references Mono.Android.Support.v4, the latest version 4.4.0.2 uses the new Android Support Library.
Hope this helps.
Alex

facebook loginbutton sdk in c# crashing application

I need a small help
I have created a small physioit app for windows phone 8.
I have added facebookclient loginbutton in my xaml file.
Now when there is no data connection in my phone and when I run the code, it gives me TargetInvocationException and my app crashes.
Here is the exception I am getting –
innerException
{Facebook.WebExceptionWrapper: The remote server returned an error: NotFound. --->
System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
--- End of inner exception stack trace ---}
System.Exception {Facebook.WebExceptionWrapper}
How can I catch this exception?
I am using the facebook sdk to create the loginbutton
Here is the code snippet
<facebookControls:LoginButton
x:Name="loginButton"
Grid.Row="2"
Margin="5"
HorizontalAlignment="Right"
FetchUserInfo="True"
ApplicationId="xxxxxx"
SessionStateChanged="OnFacebookSessionStateChanged"
UserInfoChanged="OnFacebookUserInfoChanged"
AuthenticationError="LoginButtonAuthenticationError" />
Can you please help me out.
You could use NetworkInterface to check whether data connection is available or not and then allow the login button to do its action.
Something like this..
if(System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
//Allow login button
else
//Message user - no internet connection

Monodevelop 2.8.6 on windows

I hope someone can answer this as its driving me crazy. I have installed Monodevelop on windows XP. The version being 2.8.6.5. I set the default/active runtime as Microsoft .Net and set my projects to target .net 4.0 via project settings BUILD-->General->Target framework.
When I debug it from the application output window it loads XSP 2.0 and tries to the old .Net 2 DLL's ie from the .Net 2 GAC - C:\windows\assembly instead of the .Net 4 GAC.
when I debug setting Mono as the active runtime it works ok.
I get the error, which is understandable given the fact the build is targeting .Net 4 yet its looking at the wrong runtime:
Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Here is the output from the Output window:
Loaded Module 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'
Started Thread 1872
Loaded Module 'C:\Program Files\MonoDevelop\bin\xsp2.exe'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\MonoDevelop.Xsp\2.8.0.0__0738eb9f132ed756\MonoDevelop.Xsp.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll'
many thanks
Simon.