I've taken the Github sample:
C:\Temp\DocIO-Examples-main\Getting-Started\.NET-MAUI\Create-Word-document\ to use in my .NET Maui app.
The demo project compiles and runs correctly, however, when I run my app, I'm getting the follwing error.
Partial method 'SaveService.SaveAndView(string, string, MemoryStream)' must have an implementation part because it has accessibility modifiers.
Here is my Save Service class:
using System.IO;
using System.Threading.Tasks;
namespace Create_Word_document.Services
{
public partial class SaveService
{
//Method to save document as a file and view the saved document.
public partial void SaveAndView(string filename, string contentType, MemoryStream stream);
}
}
And here is the calling function.
using MemoryStream ms = new();
//Saves the Word document to the memory stream.
document.Save(ms, FormatType.Docx);
ms.Position = 0;
//Saves the memory stream as file.
SaveService saveService = new();
saveService.SaveAndView("Sample.docx", "application/msword", ms);
I've checked everything but the versions of the Synfusion DocIO NuGet packages.