0

In my ASP.NET MVC application, I want to update the contents of a css or js file which is embedded inside my dll at runtime, without restarting the application.

My application takes a long time to restart, so in development I'd rather not wait for minutes at a time to see changes in js or css.

Jax
  • 6,860
  • 4
  • 27
  • 38
JC Raja
  • 5,597
  • 2
  • 18
  • 10

1 Answers1

1

I think Embedded resources are not meant to be changed in the runtime at all. It is almost same as you cannot modify the bytes (compiled from your source code) within your assembly at runtime. You may consider a different architecture for your Application so that you won't need to update your embedded resource at runtime. Especially for JS and CSS, they can be added in the runtime and they can be served by your server without any need to be embedded.

Anyway, I understand that you may have the need to embed the resource and so, here is the link I found, maybe useful for you: Programmically embed resources in a .NET assembly

Emran Hussain
  • 11,551
  • 5
  • 41
  • 48
  • Emran, Thanks for the update. I have tried using Mono.Cecil to manage(replace or add or remove) embedded resources from dll at runtime both from dll in bin folder and also from dll in asp.net temp files directory. Even if I update the dll in the asp.net temp files directory, the changes are not reflecting. So from where it is fetching the resource files at runtime? – JC Raja Oct 16 '14 at 07:02