I have a project with a .txt file in a folder. The .txt file is set to Embedded Resource.
I use this code to read it:
var assembly = Assembly.GetExecutingAssembly();
var manifestResources = assembly.GetManifestResourceNames();
string s = manifestResources.Single(c => c.EndsWith("Cats.txt"));
Which works great.
However I updated Cats.txt and noticed my project didn't update.
I deleted Cats.txt and found that it is still working fine and reading the file.
I tried cleaning my solution, rebuilding, and iisreset, but it seems to insist the file is still there in the assembly despite me removing it.
Any ideas?
Actually, the problem is solved by Cleaning the solution first, and then Building it again. I did not have to quit Visual Studio to update my embedded resource.
Rebuild solution (or startup project) updates embedded resources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With