Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Could not load assembly System.Web.Mvc

$
0
0

I saw multiples post/question about it on StackOverflow but about ASP.NET

I am getting the following:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Perhaps it doesn't exist in the Mono for Android profile?

File name: 'System.Web.Mvc.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00099] in /Users/builder/data/lanes/5749/9cfa7836/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:229
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in /Users/builder/data/lanes/5749/9cfa7836/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:179
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver, System.Collections.Generic.ICollection`1[T] assemblies, Mono.Cecil.AssemblyDefinition assembly, System.Boolean topLevel) [0x0015c] in <998d78d5ee6d46b491b77aff8eeaf856>:0
at Xamarin.Android.Tasks.ResolveAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver) [0x001c7] in <998d78d5ee6d46b491b77aff8eeaf856>:0 (NightLine.Droid)

Now the interesting point is that my project isn't an ASP.NET project att all x) So first, what the hell?

I did this video: https://channel9.msdn.com/Shows/XamarinShow/Snack-Pack-15-Upgrading-to-XamarinForms-to-NET-Standard

I upgrated the .NET Standard project to 2.0. My Android target is 8.0 and the compiler as well. I tried to upgrade all of my Xamarin.Android.* packages but no success...

Any idea?

Thanks


Pricing for using Xamarin and Visual Studio

$
0
0

Hi,

I'm thinking about developing an application for IOS and Android with Xamarin. If I check the pricing it seems to be free of charge for individuals and small companies. Is this really the case? Even if I develop an app with in-app purchase? Or should I pay any fees for using Xamarin and VS and/or when the app will be uploaded to the app store and purchased by users ? Thanks !!

How to handle OutOfMemory Exception in xamarin.android

$
0
0

Hey
I am new to Android

I am resizing a Bitmap, for this when I create a blank Bitmap with a high resolution, it throws OutOfMemory Exception. How to deal with this.

public Bitmap getResizedBitmap(Bitmap originalBitmap, int maxWidth, int maxHeight)
{
Bitmap res = Bitmap.CreateBitmap(4000, 4000, Bitmap.Config.Argb8888);
Canvas can = new Canvas(res);
Paint paint = new Paint();
paint.FilterBitmap = false;
can.DrawBitmap(originalBitmap, new Matrix(), paint);

    return res;
}

When I choose for low resolution Bitmap then it works fine and the issue is with the high resolution images.

I also noticed that when I give different resolution in compared to originalBitmap then the output of the res is cropped, and not resized.

Any help would be appreciated.

What is the best way to migrate an app from Xamarin.Forms to Xamarin.Android?

$
0
0

I have several Xamarin.Forms applications that I would like to convert to Xamarin.Android and I'm wondering what the best way to go about this is. Any help is appreciated!

Cannot unit test CocosSharp objects

$
0
0

I want to use CocosSharp objects in my unit tests, but it always throws me vague NotImplementedExceptions. If I run this test:
[TestMethod]
public void MyTestCase()
{
CCPoint myPoint = new CCPoint(3, 4);
}

it throws a NotImplementedException that originates from the constructor of CCPoint, and the stack trace shows only that. Now, if I change it to
CCPoint myPoint = new CCPoint() { X = 3, Y = 4 };
it works. But I can't rely on tricks like this all the time. Also, if I run the code that I test from an Android project, no exceptions are thrown, it works there just fine! What it this thing then? Do you know?

OnPlatform doesn't work - No property, bindable property, or event found for 'WidthRequest'...

$
0
0

I can't use OnPlatform almost nowhere, with the same error always.

For example:

"No property, bindable property, or event found for 'WidthRequest', or mismatching type between value and property."

On this simple XAML code:

                    <Image
                        HorizontalOptions="CenterAndExpand"
                        Source="{Binding LockImageSource}"
                        VerticalOptions="Center">
                        <Image.WidthRequest>
                            <OnPlatform x:TypeArguments="x:Double">
                                <On Platform="iOS">30</On>
                                <On Platform="Android">48</On>
                            </OnPlatform>
                        </Image.WidthRequest>
                    </Image>

How can I load an image from an ImageSource to use in Skia?

install nuget

$
0
0

The package 'Xamarin.Android.Support.Core.UI 26.1.0.1' could not be installed. You are trying to install this package in a project that has 'MonoAndroid, Version = v6.0'


There was an internal issue with the rendering process

$
0
0

I am using Xamarin on Visual Studio Enterprise 2017 RC on Windows 10. I linked up Xamarin to my Mac build server. When I try to preview the default app template with the Previewer, I get this error:

Logs attached. In particular, it looks like it's iOS that is screwing up.

system: Dec 25 05:11:35 ns ids_simd[6182]: (Error) IDSSimulatorSupport: <IDSSimSupportLocalServer.m __68-[IDSSimSupportLocalServer setNetworkSimulation:enabled:completion:]_block_invoke:544> message send of data {
        ControlCmd = SetNetSimulationEnabledCmd;
        Enabled = 0;
        ServiceName = "com.apple.private.alloy.sockpuppet.classd";
    } failed with error Error Domain=com.apple.idssimualtorsupport.errors Code=2 "(null)" UserInfo={NSUnderlyingError=0x7fec4ad19880 {Error Domain=NSMachErrorDomain Code=268435459 "(ipc/send) invalid destination port"}}
Dec 25 05:11:35 ns companionappd[6187]: (Error) WatchKit: <SPTransport.m __67-[SPTransport service:account:identifier:didSendWithSuccess:error:]_block_invoke:415> __67-[SPTransport service:account:identifier:didSendWithSuccess:error:]_block_invoke identifier (3BC7427D-2DDA-4FDD-821A-4EE4E1F6D8BF), serviceName ((null)), success: 0 error, domain: com.apple.identityservices.error, code: 23
Dec 25 05:11:35 ns companionappd[6187]: (Error) WatchKit: <SPCompanionAppServer.m __75-[SPCompanionAppServer sendProtobuf:sender:timeOut:allowInsecureTransport:]_block_invoke:894> sendProtobuf failed, error : Error Domain=com.apple.identityservices.error Code=23 "Timed out" UserInfo={NSLocalizedDescription=Timed out, NSUnderlyingError=0x7fada3c26e50 {Error Domain=com.apple.ids.idssenderrordomain Code=12 "(null)"}}
Dec 25 05:11:35 ns companionappd[6187]: (Error) WatchKit: <SPTransport.m __67-[SPTransport service:account:identifier:didSendWithSuccess:error:]_block_invoke:415> __67-[SPTransport service:account:identifier:didSendWithSuccess:error:]_block_invoke identifier (83FF6432-F944-4F84-945E-FBE6C35FD8EF), serviceName ((null)), success: 0 error, domain: com.apple.identityservices.error, code: 23
Dec 25 05:11:35 ns companionappd[6187]: (Error) WatchKit: <SPCompanionAppServer.m __75-[SPCompanionAppServer sendProtobuf:sender:timeOut:allowInsecureTransport:]_block_invoke:894> sendProtobuf failed, error : Error Domain=com.apple.identityservices.error Code=23 "Timed out" UserInfo={NSLocalizedDescription=Timed out, NSUnderlyingError=0x7fada3c260a0 {Error Domain=com.apple.ids.idssenderrordomain Code=12 "(null)"}}

system: Dec 25 05:11:42 ns sharingd[6193]: 05:11:42.580 : Failed to send SDURLSessionProxy startup message, error Error Domain=com.apple.identityservices.error Code=23 "Timed out" UserInfo={NSLocalizedDescription=Timed out, NSUnderlyingError=0x7ff483482a10 {Error Domain=com.apple.ids.idssenderrordomain Code=12 "(null)"}}

Logs attached.

NavigationPage + soft back-button don't work on a device

$
0
0

Hello -

The navigation system taken from a sample (I cannot post a link: developer.xamarin.com > /guides/xamarin-forms/getting-started/hello-xamarin-forms-multiscreen/quickstart/) works on one of my phones, while it doesn't fully work on another.

The part that does not function is the OS-provided back-button: it does nothing, even though the button itself provides the "tap" feedback. Everything is exactly the same, as far as app code and configuration, between the two phones. Pressing the back-button on the "working" phone acts as if I pressed the back-arrow located within Xamarin-provided navigation bar on the top of the screen.

The "non-working" phone is LG G6, running Android 7.0. I'm not sure if its software-navigation bar is a part of OS or LG's launcher. The phone's screen has round corners, with the concept of classic full-screen possibly changed somewhat. I don't know how to explain it briefly; if anyone is interested, I can try to provide some more details and screenshots. The point is, there could be some new event related to this that Xamarin's navigation isn't paying attention to.

How to link my application with an online database for eg SQL database

$
0
0

How to link my application with an online database for eg SQL database

Unable to open project in Visual Studio for mac

$
0
0

I have been working on a selenium project in visual studio, I would like to open this in visual studio for mac to execute the test using the mac web driver.

But when I open it I get

"This project type is not supported by Visual Studio Community 2017 For Mac"

I am pretty sure it has opened before, is there anything I need to change in the project to get this working

Here is my package list

        <?xml version="1.0" encoding="utf-8"?>
        <packages>
          <package id="EntityFramework" version="6.1.3" targetFramework="net451" />
          <package id="ExtentReports" version="3.0.2" targetFramework="net452" />
          <package id="MSTest.TestAdapter" version="1.1.11" targetFramework="net452" />
          <package id="MSTest.TestFramework" version="1.1.11" targetFramework="net452" />
          <package id="Selenium.Support" version="3.4.0" targetFramework="net452" />
          <package id="Selenium.WebDriver" version="3.4.0" targetFramework="net452" />
          <package id="System.Data.Common" version="4.3.0" targetFramework="net451" />
          <package id="System.Data.SqlClient" version="4.3.1" targetFramework="net452" />
          <package id="TestToolsToXunitProxy" version="0.0.4" targetFramework="net451" />
          <package id="xunit" version="2.2.0" targetFramework="net452" />
          <package id="xunit.abstractions" version="2.0.1" targetFramework="net452" />
          <package id="xunit.assert" version="2.2.0" targetFramework="net452" />
          <package id="xunit.core" version="2.2.0" targetFramework="net452" />
          <package id="xunit.extensibility.core" version="2.2.0" targetFramework="net452" />
          <package id="xunit.extensibility.execution" version="2.2.0" targetFramework="net452" />
          <package id="xunit.runner.console" version="2.2.0" targetFramework="net452" developmentDependency="true" />
          <package id="xunit.runner.visualstudio" version="2.2.0" targetFramework="net452" developmentDependency="true" />
        </packages>

Here is my csproj

        <?xml version="1.0" encoding="utf-8"?>
        <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
          <Import Project="..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" />
          <Import Project="..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props')" />
          <PropertyGroup>
            <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
            <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
            <ProjectGuid>{2AB44E28-7408-43D5-A381-029177F579D0}</ProjectGuid>
            <OutputType>Library</OutputType>
            <AppDesignerFolder>Properties</AppDesignerFolder>
            <RootNamespace>LegacyUITests</RootNamespace>
            <AssemblyName>LegacyUITests</AssemblyName>
            <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
            <FileAlignment>512</FileAlignment>
            <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
            <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
            <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
            <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
            <IsCodedUITest>False</IsCodedUITest>
            <TestProjectType>UnitTest</TestProjectType>
            <NuGetPackageImportStamp>
            </NuGetPackageImportStamp>
          </PropertyGroup>
          <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
            <DebugSymbols>true</DebugSymbols>
            <DebugType>full</DebugType>
            <Optimize>false</Optimize>
            <OutputPath>bin\Debug\</OutputPath>
            <DefineConstants>DEBUG;TRACE</DefineConstants>
            <ErrorReport>prompt</ErrorReport>
            <WarningLevel>4</WarningLevel>
          </PropertyGroup>
          <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
            <DebugType>pdbonly</DebugType>
            <Optimize>true</Optimize>
            <OutputPath>bin\Release\</OutputPath>
            <DefineConstants>TRACE</DefineConstants>
            <ErrorReport>prompt</ErrorReport>
            <WarningLevel>4</WarningLevel>
          </PropertyGroup>
          <ItemGroup>
            <Reference Include="ExtentReports, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
              <HintPath>..\packages\ExtentReports.3.0.2\lib\ExtentReports.dll</HintPath>
            </Reference>
            <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
              <HintPath>..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
            </Reference>
            <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
              <HintPath>..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
            </Reference>
            <Reference Include="System" />
            <Reference Include="System.Core" />
            <Reference Include="System.Data" />
            <Reference Include="System.Data.SqlClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
              <HintPath>..\packages\System.Data.SqlClient.4.3.1\lib\net451\System.Data.SqlClient.dll</HintPath>
            </Reference>
            <Reference Include="System.Drawing" />
            <Reference Include="WebDriver, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL">
              <HintPath>..\packages\Selenium.WebDriver.3.4.0\lib\net40\WebDriver.dll</HintPath>
            </Reference>
            <Reference Include="WebDriver.Support, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL">
              <HintPath>..\packages\Selenium.Support.3.4.0\lib\net40\WebDriver.Support.dll</HintPath>
            </Reference>
            <Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
              <HintPath>..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
            </Reference>
            <Reference Include="xunit.assert, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
              <HintPath>..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
            </Reference>
            <Reference Include="xunit.core, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
              <HintPath>..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
            </Reference>
            <Reference Include="xunit.execution.desktop, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
              <HintPath>..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
            </Reference>
          </ItemGroup>
          <ItemGroup>
            <Compile Include="Methods\General.cs" />
            <Compile Include="Objects\Elements\AdminElements.cs" />
            <Compile Include="Objects\Elements\AssessorElements.cs" />
            <Compile Include="Objects\Elements\DinerApplyElements.cs" />
            <Compile Include="Objects\Elements\QuizElements.cs" />
            <Compile Include="Objects\Pages\AdminPages.cs" />
            <Compile Include="Objects\Pages\AssessorPage.cs" />
            <Compile Include="Objects\Pages\DinerApply.cs" />
            <Compile Include="Objects\Pages\HomePage.cs" />
            <Compile Include="Objects\Pages\QuizPage.cs" />
            <Compile Include="Tests\Admin\AdminTests.cs" />
            <Compile Include="Tests\Apply\DinerApplyTests.cs" />
            <Compile Include="Tests\Assessor\AssessorTests.cs" />
            <Compile Include="Tests\Assessor\TakeTheQuiz.cs" />
            <Compile Include="Tests\Filters\FiltersTest.cs" />
            <Compile Include="Tests\Main\LegacySmokeTest.cs" />
            <Compile Include="Properties\AssemblyInfo.cs" />
            <Compile Include="Tests\Rules\RulesTest.cs" />
            <Compile Include="Tests\Sandbox\Sandbox.cs" />
          </ItemGroup>
          <ItemGroup>
            <None Include="Drivers\chromedriver" />
            <None Include="packages.config" />
          </ItemGroup>
          <ItemGroup>
            <Folder Include="Reports\" />
            <Folder Include="Screenshots\" />
          </ItemGroup>
          <ItemGroup>
            <Content Include="Drivers\chromedriver.exe" />
          </ItemGroup>
          <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
          <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
          <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
            <PropertyGroup>
              <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
            </PropertyGroup>
            <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props'))" />
            <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets'))" />
            <Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props'))" />
          </Target>
          <Import Project="..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets')" />
        </Project>

Any help would be appreciated

UWP background task give errors on List DateTime and IComparable

$
0
0

Hi all you knowledgeable developers,
I followed the steps for creating an out-of-process background task for the Xamarin Forms UWP portion of my app here:
https://docs.microsoft.com/en-us/windows/uwp/launch-resume/create-and-register-a-background-task
and I can do a "Hello world" call to the Background.

Now I want to actually do something and came up against some nasty compile errors of which here are a couple:

This line:
public DateTime LastLoginDate { get; set; }
gives this error:
Method 'MyApp.Models.UserShort.LastLoginDate.get()' returns 'System.DateTime', which is not a valid Windows Runtime type. Methods exposed to Windows Runtime must return only Windows Runtime types.

And this line:
public class CountID : IComparable<CountID>
gives this error:
Type 'BGActivities.Models.CountID' implements interface 'System.IComparable<BGActivities.Models.CountID>', which is not a Windows Runtime interface. All interfaces that are implemented by exported types must be Windows Runtime interfaces.

How can I get get to use DateTime and IComparable?
Have I missed some step in setting up the Background task?
Would there be plugins that I have left out?

Thanks!

Media Plugin and uwp

$
0
0

Hello,

I'm trying to take a picture in my Forms app (code sharing is plc). For this I try to use the media plugin by James (github.com/jamesmontemagno/MediaPlugin)

The code is copied from the readme, (see below)
- the Initialize() function is called

  • the permissions are ok (I've checked with the persmissions plugin)

But the TakePhotoAsync call immediatly returns null, camera does not appear (On UWP I haven't been able to test on other devices yet ).

Please help!

takePhoto.Clicked += async (sender, args) =>
{
    await CrossMedia.Current.Initialize();

    if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
    {
        DisplayAlert("No Camera", ":( No camera available.", "OK");
        return;
    }

    var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
    {
        Directory = "Sample",
        Name = "test.jpg"
    });

    if (file == null)
        return;
}

Pop Display Alert/ Message from ViewModel

$
0
0

Guys.

How do i invoke/ call display alert/show message once my program did some logic in ViewModel (MVVM)?

E.g

  1. Login Form --> Enter Login Data ---> Click Login Button---> Bind button command to LoginViewModel

Lets say the program done the login validation..how do i send back the login result to Login Page (assuming if login failed) ?


Using embedded images as the image for a Button?

$
0
0

Hi,

We are using Xamarin.Forms to build the UI for an iOS app and we have just hit a problem with using images on buttons. We divide our UI based on function areas and thus we have separate projects for each functional area. As a result, we hope to contain the graphics for a particular functional area to only within that project. This, unfortunately, means that we can only use embedded resources to retrieve those graphics. However, the Button view doesn't seem to accept an image that comes out from an embedded resource, but rather only an image that is loaded from a file. Has anyone encountered this problem? Besides putting those graphics into the main app project's Resources folder (so they will become part of the bundle), is there any other way to solve this problem?

Thanks.

GW

Xamarin.iOS Designer not loading

$
0
0

The iOS designer no longer loads any xib or storyboard files for any project. It is stuck with the progress bar working indefinitely. My setup:
1. Windows 7 and Visual Studio 2017 Enterprise Version 15.4.5
2. Xamarin 4.7.10.38, Xamarin.iOS 11.3.0.47
3. Mac OS 10.13.1
4. XCode 9.1

What I have tried:
1. Restarting both machines
2. Cleaning (physically removing all bin and obj folders) and rebuilding
3. Deleting username/Library/Caches/Xamarin/XMA on the Mac and username\AppData\Local\Temp\Xamarin\XMA on the PC.

As of last week it was working fine and now it's broken. The only thing I'm aware of changing was the Mac installed a security update and rebooted. Also worth noting: the designer works fine in VS Community on the Mac, and on a different PC with Windows 10 and VS 2017.

Preventing the cursor from jumping to the end of an entry when modifying its text from code

$
0
0

I have a behavior attached to an entry which adds a separator character after every x digits. It works well, for the most part. But if I try to go to the middle of the entry and type, every time I type a digit, the cursor jumps to the end. The digit is added in the correct place and my separators are kept in the correct locations, but the cursor is moved to the end of the entry instead of where it should be, right after the last digit that was typed. Is there a way I can prevent this from happening (and keep the cursor where it is supposed to be) when my behavior changes the text contained in the entry?

MySql errorr conn.open

$
0
0

MySqlConnection conn = new MySqlConnection("server= sql12.freesqldatabase.com;port=3306;database=sql12206166;User Id=sql12206166;password=R4qBiIdj88;charset=utf8");

        try
        {
            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
                textView1.Text = "open";
            }
        }
        catch (MySqlException ex)
        {
            new AlertDialog.Builder(this)
             .SetMessage(ex.ToString())
             .SetTitle("hala")
             .SetPositiveButton("Close", (sender, args) =>
              {

              })
              .Show();
        }

i have error in conn.open();
Unhandled Exception:

System.FormatException: Input string was not in a correct format. occurred

Importing NSPerformService

$
0
0

I've tried to import NSPerformService and got this so far:
[System.Runtime.InteropServices.DllImport("System/Library/Frameworks/AppKit.framework/Versions/C/AppKit")]<br /> static extern bool NSPerformService(string item, NSPasteboard pboard);

Unfortunately, when I call it I get System.Runtime.InteropServices.MarshalDirectiveException:

Type AppKit.NSPasteboard which is passed to unmanaged code must have a StructLayout attribute.

I realize that it is something about marshaling, so that probably NSPasteboard should be sent like IntPtr or something else, but I have no idea on how to do that (this thread contains the solution when this happens on the return value, but it can't be applied when the problem is in the argument: https://forums.xamarin.com/discussion/57248/type-foundation-nsdictionary-which-is-passed-to-unmanaged-code-must-have-a-structlayout-attribute).

I guess the answer would help to other people that might have similar problem in the future as there aren't too many threads regarding this and definitely not about this specific issue.

Viewing all 204402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>