Posts

Showing posts from July, 2019

Renaming XML elements and attributes in XML data columns in Microsoft SQL Server using T-SQL

We've recently had an issue whereby we wanted to rename an XML attribute that is stored in an XML data column within SQL Server. There are several ways to achive this Cast the column to NVARCHAR(MAX) and perform a string replacement. This is a bit risky as you're not working with strongly typed data. Perform the update from the .NET application obtaining the data from SQL and performing the transformation in .NET. This has the advantage of having the power of .NET to perform the modification. You also get error handling as you can loop through each result and perform the XML transformation and if you detect an error you can see exactly which table row caused the issue, you can also run the whole update in a transaction. Perform the update within T-SQL using the XML methods built into SQL Server. This has the advantage of being able to be run directly within SQL Management Studio, and within a transaction. It can also therefore be run as part of the installation, with oth...

The file 'filename' has not been pre-compiled, and cannot be requested is seen running ASP.NET applications on IIS.

When you try and access a .NET Web Application you may see the following error The file ' filename ' has not been pre-compiled, and cannot be requested. Something similar may be seen in the Windows event log Event code: 3005 Event message: An unhandled exception has occurred. Event time: 7/9/2019 2:07:35 PM Event time (UTC): 7/9/2019 1:07:35 PM Event ID: fd2c08888c744bd4a1ccfae079ba7c53 Event sequence: 73 Event occurrence: 6 Event detail code: 0 Application information:     Application domain: /LM/W3SVC/1/ROOT/ ApplicationName -1-132071511520435099     Trust level: Full     Application Virtual Path: /Path     Application Path: C:\YourDirectory     Machine name: MachineName If you've followed the other guides on the internet and ensured that you have compiled for the correct version of the .NET Framework you may want to check and delete the temp...