Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded resource txt file is not updating

Tags:

c#

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?

like image 705
NibblyPig Avatar asked Mar 17 '23 18:03

NibblyPig


2 Answers

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.

like image 108
classtemplateT Avatar answered Apr 07 '23 22:04

classtemplateT


Rebuild solution (or startup project) updates embedded resources.

like image 28
tchelidze Avatar answered Apr 07 '23 21:04

tchelidze