Xamarin & # 8594; System.Reflection.Assembly.GetExecutingAssembly does not work

I am trying to include a CSV file in my xamarin.forms project. The problem is that I think it is available only for all platforms at once, when I use this file as an embedded resource. My assembly has only three methods:

Equals() Load() ReferenceEquals() 

But I need Assembly.GetExecutingAssembly() to get my code working.

Do you know how to solve this? Or maybe an alternative? Btw: I am working with Visual Studio 2013 Ultimate and trial license Xamarin.Android/iOS

Edit: I assume this needs to be done. with Xamarin.Forms. A typical desktop application has Assembly.GetExecutingAssembly (); and it works fine, but I need this in my application :(

Edit 2: I'm trying this now: http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/files/#Loading_Files_Embedded_as_Resources

+5
source share
1 answer

Do it like this:

 var assembly = typeof(App).GetTypeInfo().Assembly; 

Being an "App" is the type of your application file.

I did exactly what you want (by reading the csv file) this way.

+5
source

Source: https://habr.com/ru/post/1205151/


All Articles