Convert JSON String to JSON Object c#

I have this String stored in my database: str = “{ “context_name”: { “lower_bound”: “value”, “upper_bound”: “value”, “values”: [ “value1”, “valueN” ] } }” This string is already in the JSON format but I want to convert it into a JObject or JSON Object. JObject json = new JObject(); I tried the json = (JObject)str; … Read more

Error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level

It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level. The top line in all of my aspx pages in my /portal/ directory has this error message, and I know it’s a common one. I have googled this error message to no end, and I see a lot of posts telling … Read more

How to return a file (FileContentResult) in ASP.NET WebAPI

In a regular MVC controller, we can output pdf with a FileContentResult. public FileContentResult Test(TestViewModel vm) { var stream = new MemoryStream(); //… add content to the stream. return File(stream.GetBuffer(), “application/pdf”, “test.pdf”); } But how can we change it into an ApiController? [HttpPost] public IHttpActionResult Test(TestViewModel vm) { //… return Ok(pdfOutput); } Here is what … Read more

Could not find any resources appropriate for the specified culture or the neutral culture

I have two ASP.NET Web projects (ProjectA and ProjectB). When class in ProjectA is instantiating a class of ProjectB which uses a resource file Blah.resx, I get this error: An exception of type ‘System.Resources.MissingManifestResourceException’ occurred in mscorlib.dll but was not handled in user code. Could not find any resources appropriate for the specified culture or … Read more

What is Kestrel (vs IIS / Express)

What is the kestrel web server and how does it relate to IIS / IIS Express? I come from developing apps on IIS Express and hosting them on an IIS web server. With ASP.NET Core I have a dependency on Microsoft.AspNetCore.Server.Kestrel and my startup has .UseServer(“Microsoft.AspNetCore.Server.Kestrel”). But when I run my website, I still get … Read more

I’ve programmed in both classic ASP and ASP.NET, and I see different tags inside of the markup for server side code. I’ve recently come across a good blog on MSDN that goes over the difference between: <%= (percentage together with equals sign) and <%# (percent sign and hash/pound/octothorpe) (<%# is evaluated only at databind, and … Read more