SharePoint Error "File Not Found" on custom .aspx files since July 11

Alex Miller 0 Reputation points
2024-07-15T12:42:11.68+00:00

Good Morning,

I am a Site Owner (not SharePoint Admin), and I use a Document Library to host .aspx files to provide users some useful tools, coded with jQuery interacting with SP's API. Everything runs very well.

Since July 11, as soon as I update an .aspx file, I am no longer able to access the file with the Web Browser, I get this error:

Screenshot 2024-07-15 083005

It says, "File Not Found", but yes, the file exists in the Document Library.

All other .aspx files, not updated since July 11, are running as they should. As soon as I change the file in the Document Library, the error starts to pop (e.g., my file Hello.aspx works fine. If I change something in the aspx file, and save it to the Document Library, the error appears, and we are no longer able to run the file in the Web Browser).

If I go further, with Web Dev Tools, and inspecting the GET request with the Network tab, I can see this in the response:

"isNoScriptEnabled": true

Does that mean an Admin has disabled Custom Scripts? Is this a consequence of recent Security Fixes on O365 products? I don't know where to search and how to fix my problem. Any ideas? Thanks!

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,790 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Haoyan Xue_MSFT 21,996 Reputation points Microsoft Vendor
    2024-07-16T02:56:17.8966667+00:00

    Hi @Alex Miller ,

    Yes, after my testing, this is because the administrator has disabled custom scripts. You can also verify custom script status in the active sites of the sharepoint admin center.

    User's image

    User's image

    To allow custom script on a particular site immediately, follow these steps:

    1. Download the latest SharePoint Online Management Shell.

    Connect to SharePoint as a SharePoint Administrator in Microsoft 365. To learn how, see Getting started with SharePoint Online Management Shell.

    1. Run the following command.
         Set-SPOSite
      
      or by means of the PnP.PowerShell cmdlet Set-PnPSite
         Set-PnPSite -Identity
      

    Reference:https://learn.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments