From 4b9a2951f497e2f029565e9f02d1e0117653cbcb Mon Sep 17 00:00:00 2001 From: Dharanya Sakthivel Date: Wed, 22 Jul 2026 16:05:37 +0530 Subject: [PATCH] ES-1042617 Sample changes --- .../Create-Word-Document/Controllers/HomeController.cs | 2 +- .../AWS/Console_Application/Create-Word-Document/Program.cs | 4 ++-- .../Create-Word-Document/Controllers/HomeController.cs | 2 +- .../Console_Application/Create-Word-Document/Program.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Getting-Started/ASP.NET-Core/Create-Word-Document/Controllers/HomeController.cs b/Getting-Started/ASP.NET-Core/Create-Word-Document/Controllers/HomeController.cs index 5d4191474..fa1417504 100644 --- a/Getting-Started/ASP.NET-Core/Create-Word-Document/Controllers/HomeController.cs +++ b/Getting-Started/ASP.NET-Core/Create-Word-Document/Controllers/HomeController.cs @@ -242,7 +242,7 @@ public ActionResult CreateDocument() stream.Position = 0; //Download Word document in the browser. - return File(stream, "application/msword", "Sample.docx"); + return File(stream, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Sample.docx"); } } diff --git a/Getting-Started/AWS/Console_Application/Create-Word-Document/Program.cs b/Getting-Started/AWS/Console_Application/Create-Word-Document/Program.cs index 59cb588da..0dd51bf19 100644 --- a/Getting-Started/AWS/Console_Application/Create-Word-Document/Program.cs +++ b/Getting-Started/AWS/Console_Application/Create-Word-Document/Program.cs @@ -38,8 +38,8 @@ static void Main(string[] args) //Read the response stream var stream = new StreamReader(response.Payload); JsonReader reader = new JsonTextReader(stream); - var serilizer = new JsonSerializer(); - var responseText = serilizer.Deserialize(reader); + var serializer = new JsonSerializer(); + var responseText = serializer.Deserialize(reader); //Convert Base64String into Word document byte[] bytes = Convert.FromBase64String(responseText.ToString()); diff --git a/Getting-Started/Azure/Azure_App_Service/Create-Word-Document/Controllers/HomeController.cs b/Getting-Started/Azure/Azure_App_Service/Create-Word-Document/Controllers/HomeController.cs index bc7a07807..1c1320e6b 100644 --- a/Getting-Started/Azure/Azure_App_Service/Create-Word-Document/Controllers/HomeController.cs +++ b/Getting-Started/Azure/Azure_App_Service/Create-Word-Document/Controllers/HomeController.cs @@ -245,7 +245,7 @@ public ActionResult CreateWordDocument() document.Save(stream, FormatType.Docx); //Download Word document in the browser. - return File(stream, "application/msword", "Sample.docx"); + return File(stream, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Sample.docx"); } } public IActionResult Privacy() diff --git a/Getting-Started/Azure/Azure_Functions/Console_Application/Create-Word-Document/Program.cs b/Getting-Started/Azure/Azure_Functions/Console_Application/Create-Word-Document/Program.cs index 2ace19f50..1c74db7ef 100644 --- a/Getting-Started/Azure/Azure_Functions/Console_Application/Create-Word-Document/Program.cs +++ b/Getting-Started/Azure/Azure_Functions/Console_Application/Create-Word-Document/Program.cs @@ -46,7 +46,7 @@ static void Main(string[] args) } catch (Exception ex) { - throw; + Console.WriteLine("Error: " + ex.Message); } //Launch the output Word document