Tagged with webresource
Using the ASP.NET 2.0 Web Resource Attribute
ASP.NET 2.0 has a really nice feature that lets you compile site or component resources like javascript files into your assembly file instead of deploying these shared files to the wwwroot/aspnet_client directory like in ASP.NET 1.x. This makes your component/website much easier to deploy because it means you can keep everything you need in one [...]Published in ASP.NET, Server controls on Wednesday, January 11th, 2006
The resource cannot be found.
I was playing around with embedded web resources and was having a problem loading some javascript files. When I cut and paste the script link from the source of my page into the browser’s address bar I got the following error message: The resource cannot be found. Description: HTTP 404. The resource you are looking [...]Published in ASP.NET, Server controls on Wednesday, January 11th, 2006
Accessing embedded resource files
To get a resource from the current assembly: Stream stream = this.GetType().Assembly().GetManifestResourceStream("namespace.file"); To get all the names of all the resources in your current assembly: string[] resources = this.GetType().Assembly.GetManifestResourceNames(); foreach(string resourceName in resources) { Debug.WriteLine(resourceName); }Published in .NET on Tuesday, March 1st, 2005






