Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load the file 'I18N, Version=2.0.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'. #578 #8815

Closed
amrutha786 opened this issue Jun 9, 2020 · 8 comments
Labels
support The issue is related to support
Milestone

Comments

@amrutha786
Copy link

Steps to Reproduce

To Reproduce
Steps to reproduce the behavior:

I have created a contact Us page and upon filling all the info and click on submit I see the crash with

Describe the bug
System.IO.FileNotFoundException has been thrown

System.IO.FileNotFoundException

Could not load the file 'I18N, Version=2.0.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'.

Expected Behavior

When I click on Submit the form submits successfully

Actual Behavior

I have created a contact Us page and upon filling all the info and click on submit I see the crash with

System.IO.FileNotFoundException has been thrown
System.IO.FileNotFoundException
Could not load the file 'I18N, Version=2.0.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'.

Environment

OS: Mac OS
Visual Studio Community Version 8.4.8
MimeKit Version: 2.6.0
@amrutha786
Copy link
Author

Screen Shot 2020-06-04 at 4 38 18 PM

![Uploading Screen Shot 2020-06-04 at 5.10.40 PM.png…]()

@whitneyschmidt
Copy link
Contributor

@amrutha786 Thank you for your feedback!

For us to investigate this further, could you please provide your full build logs, crash reports (if any), test case (to reproduce) and all your version information.

It would be great if you could add a small test project that reproduces this issue - this is the most useful for us to reproduce the issue.

To get full build logs just set the log verbosity to diagnostic at the following locations:

  • On Visual Studio for Mac: Preferences > Projects > Build
  • On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

On Visual Studio for Windows you also want to add -v -v -v -v to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting Properties.

Note: this is done automatically on Visual Studio for Mac when the log verbosity is set to diagnostic.

The easiest way to get exact version information:

  • On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
  • On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.

Then copy/paste the version information (you can use the "Copy Information" button).

We look forward to hearing from you!

@whitneyschmidt whitneyschmidt added the need-info Waiting for more information before the bug can be investigated label Jun 9, 2020
@whitneyschmidt whitneyschmidt added this to the Future milestone Jun 9, 2020
@amrutha786
Copy link
Author

I am afraid i cannot create a test project at this point of time but i will be able to give you version info

=== Visual Studio Community 2019 for Mac ===

Version 8.4.8 (build 2)
Installation UUID: 8c26e0a3-9212-4b45-8a5e-68fa5bed61e4
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.25 (issue-7441-d16-3-vsmac / 881172e)

Package version: 606000166

=== Mono Framework MDK ===

Runtime:
Mono 6.6.0.166 (2019-08/d9001b5ae70) (64-bit)
Package version: 606000166

=== Roslyn (Language Service) ===

3.4.0-beta4-19562-05+ff930dec4565e2bc424ad3bf3e22ecb20542c87d

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.102/Sdks
SDK Versions:
3.1.102
3.1.101
3.0.101
2.1.701
2.1.700
2.1.505
2.1.503
2.1.302
2.1.4
2.0.3
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.2
3.1.1
3.0.1
2.1.15
2.1.14
2.1.12
2.1.11
2.1.9
2.1.7
2.1.2
2.0.5
2.0.3
2.0.0

=== Xamarin.Profiler ===

'/Applications/Xamarin Profiler.app' not found

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 10.1.3.7 (Visual Studio Community)
Commit: xamarin-android/d16-4/d66aed0
Android SDK: Not found

=== Microsoft Mobile OpenJDK ===

Java SDK: Not Found

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.4.0.10
Hash: 2c49a7d
Branch: remotes/origin/d16-4
Build date: 2020-02-20 19:25:52 UTC

=== Android Device Manager ===

Version: 16.4.0.32
Hash: 7a5cb8b
Branch: remotes/origin/d16-4
Build date: 2020-02-20 19:26:14 UTC

=== Apple Developer Tools ===

Xcode 11.1 (15405)
Build 11A1027

=== Xamarin.Mac ===

Version: 6.10.0.21 (Visual Studio Community)
Hash: 02c4b3b
Branch: xcode11.3
Build date: 2020-02-18 14:13:31-0500

=== Xamarin.iOS ===

Version: 13.10.0.21 (Visual Studio Community)
Hash: 02c4b3b
Branch: xcode11.3
Build date: 2020-02-18 14:13:32-0500

=== Xamarin Designer ===

Version: 16.4.0.479
Hash: 074544417
Branch: remotes/origin/d16-4
Build date: 2020-01-22 22:50:22 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 804080002
Git revision: 4f35aa7e44fb398379e512d0bfd6f8df8d34b5ac
Build date: 2020-02-27 16:16:52+00
Build branch: release-8.4
Xamarin extensions: 4f35aa7e44fb398379e512d0bfd6f8df8d34b5ac

=== Operating System ===

Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Mon Apr 27 20:09:39 PDT 2020
root:xnu-4903.278.35~1/RELEASE_X86_64 x86_64

@whitneyschmidt
Copy link
Contributor

whitneyschmidt commented Jun 9, 2020

Thank you for sharing the version information 👍

Could you also share the full call stack from the crash?

Would it also be possible for your to share a snippet of your code where the exception gets thrown?

A couple of things to try:

  • Upgrading to the latest version of VSMac (latest stable looks like 8.6.3).
  • Opening up your version of Xcode and installing cmd line tools if you are prompted.

One more thing - is this a Xamarin.Forms project, an iOS project, or an Android project?

@amrutha786
Copy link
Author

This is a Xamarin iOS Project

Code snippet :

        var message = new MimeMessage();
        message.From.Add(new MailboxAddress(ec_acc_name, ec_acc_email));
        message.To.Add(new MailboxAddress(e_To_name, e_To_email));
        message.Subject = e_subject;

        message.Body = new TextPart("plain")
        {
            Text = e_message
        };

System.NotSupportedException: No data is available for encoding 51936. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
at System.Text.Encoding.GetEncoding (System.Int32 codepage) [0x001b8] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/text/encoding.cs:539
at MimeKit.Utils.CharsetUtils.ProbeCharset (System.Int32 codepage) [0x00000] in D:\src\MimeKit\MimeKit\Utils\CharsetUtils.cs:131
Screen Shot 2020-06-09 at 1 35 31 PM

@whitneyschmidt whitneyschmidt added the support The issue is related to support label Jun 9, 2020
@whitneyschmidt
Copy link
Contributor

whitneyschmidt commented Jun 9, 2020

@amrutha786 This looks like an issue with using an encoding that is not supported.

Can you try installing the encoding nuget pkg and registering the encoder before you read in text?

Nuget package: https://www.nuget.org/packages/System.Text.Encoding.CodePages/

The CodePagesEncodingProvider class extends EncodingProvider to make these code pages available to .NET Core. To use these additional code pages, you do the following:

  • Add a reference to the System.Text.Encoding.CodePages.dll assembly to your project.
  • Retrieve a CodePagesEncodingProvider object from the static CodePagesEncodingProvider.Instance property.
  • Pass the CodePagesEncodingProvider object to the Encoding.RegisterProvider method.

After an EncodingProvider object is registered, the encodings that it supports are available by calling the overloads of Encoding.GetEncoding; you should not call the EncodingProvider.GetEncoding overloads.

Registering the encoder will look something like this: System.Text.Encoding.RegisterProvider (System.Text.CodePagesEncodingProvider.Instance);

msdocs link

cc @jstedfast This looks like the same issue described in jstedfast/MimeKit#330

@whitneyschmidt whitneyschmidt removed the need-info Waiting for more information before the bug can be investigated label Jun 9, 2020
@whitneyschmidt
Copy link
Contributor

whitneyschmidt commented Jun 9, 2020

Let us know what the results of trying the above are. Given our discussion, I do not believe this is a bug.

If you have additional questions on CodePagesEncodingProvider, the broader developer community would be the best and quickest place for additional troubleshooting help on this issue.
Posting a question on Stack Overflow [0] or the Xamarin Forums [1][2] would be the best next step.

[0] https://stackoverflow.com/questions/tagged/xamarin
[1] https://forums.xamarin.com/categories/ios
[2] https://forums.xamarin.com/categories/mac

@IVSoftware
Copy link

IVSoftware commented Jun 18, 2021

What fixed it for me was making sure I had a direct reference to the I18N assemblies at compile time. My iOS app was throwing a runtime exception when a Syncfusion add on attempted to load the assembly on-demand on its first use. As I understand it, I18N assemblies are compile time and because of this could not be loaded. So, after referencing the 6 assembles in my portable Xamarin project I forced a compile time load like so:

public App()
{
        ...
        try
        {
            // The I18N assemblies are COMPILE TIME assemblies. 
            // [SOLUTION] Load it NOW!
            var FORCE_AT_COMPILETIME_WORKAROUND = new I18N.West.CP1252();     
        }
        catch (Exception ex)
        {
            Debug.Assert(false, ex.Message);
        }
}

@ghost ghost locked as resolved and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
support The issue is related to support
Projects
None yet
Development

No branches or pull requests

3 participants