I was finally getting some time to update my AJAX library but hit a snag when attempting to read an embedded resource file. I was using the following test code:
private string GetResourceText(string filename){ using(Stream stream = Assembly.GetCallingAssembly().GetManifestResourceStream(filename)) { if(stream == null) { throw new HttpException(404, "File Not found"); } using(StreamReader sr = new StreamReader(stream) ) { return sr.ReadToEnd(); } }}
I was passing in the name of the file ('ajax.js') which was located in the 'JS' folder within the project but I got a 404 error so assumed that the assembly had renamed the resource 'JS\ajax.js' within the manifest so I tried that but got the same error. It turns out that embedded resource files are arranged within namespaces and it uses the default namespace of the project as the base namespace, which in this case was 'Ajax' so the correct filename was 'Ajax.JS.ajax.js'. You can check and change the default namespace in the project properties under Common Properties > General > Default Namespace in C# or Root Namespace in VB.Net.
As for the AJAX library I've vastly improved the performance and added some new features, I'll post an update once I've finished testing.
Remember Me