Manifestresource stream load gives null reference expection on some files

Manifestresource stream load gives null reference expection on some files

I'm doing a Xamarin project and having this problem and I don't know how to fix it.

I'm doing a Xamarin project and having this problem and I don't know how to fix it.

I'm trying to get some data from a .txt file. I've already fixed it and it works on one of the files, but when I switch to another file it suddenly gives me NullReferenceException.

Here's the code that works:

var assembly = IntrospectionExtensions.GetTypeInfo(typeof(ReadFromTxtFile)).Assembly;
Stream stream = assembly.GetManifestResourceStream("HanafiSalahTider.salahtider2019.txt");

using (StreamReader myreader = new StreamReader(stream)) { fileContent = myreader.ReadToEnd(); }

Here's the nonworking code:

var assembly = IntrospectionExtensions.GetTypeInfo(typeof(ReadFromTxtFile)).Assembly;
Stream stream = assembly.GetManifestResourceStream("HanafiSalahTider.salahtider.txt");

using (StreamReader myreader = new StreamReader(stream)) { fileContent = myreader.ReadToEnd(); }

Here's both files in the solution explorer:

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective

Bring Some C++ to Xamarin Apps

On this week’s Xamarin Show, James is joined by good friend Mike Parker from the Microsoft Mobile Customer Advisory Team that shows how to easily integrate existing C++ libraries into Xamarin applications. He shows us from scratch how to bridge the libraries, expose them in C#, and easily manage memory!