This project is a sample implementation of a WOPI host. Basically, it allows developers to integrate custom datasources with Office Online Server (formerly Office Web Apps) or any other WOPI client by implementing a bunch of interfaces.
- clean WebAPI built with ASP.NET Core MVC, no references to System.Web
- uses new ASP.NET Core features (configuration, etc.)
- can be self-hosted or run under IIS
- file manipulation is extracted to own layer of abstraction (there is no dependency on System.IO)
- example implementation included (provider for Windows file system)
- file identifiers can be anything (doesn't have to correspond with the file's name in the file system)
- custom token authentication middleware
- DI used everywhere
- URL generator
- based on a WOPI discovery module
- all references are NuGets
The WopiHost app targets net46
and netcoreapp2.0
. You can choose which one you want to use. If you get errors that Microsoft.CobaltCore.15.0.0.0.nupkg can't be found then just remove the reference or see the chapter "Cobalt" below.
WopiHost.Web\Properties\launchSettings.json
WopiHostUrl
- used by URL generatorWopiClientUrl
- used by the discovery module to load WOPI client URL templates
WopiHost\Properties\launchSettings.json
WopiFileProviderAssemblyName
- name of assembly containing implementation of WopiHost.Abstractions interfacesWopiRootPath
- provider-specific setting used by WopiFileSystemProvider (which is an implementation of IWopiFileProvider working with System.IO)server.urls
- hosting URL(s) used by Kestrel. Read more...
Once you've successfully built the app you can:
- run it directly from the Visual Studio using IIS Express or selfhosted.
- make sure you run both
WopiHost
andWopiHost.Web
. You can set them both as startup projects
- make sure you run both
- run it from the
cmd
- navigate to the WopiHost folder and run
dotnet run
- navigate to the WopiHost folder and run
- run it in IIS (tested in IIS 8.5)
- navigate to the WopiHost folder and run
dnu publish --runtime active
- copy the files from WopiHost\bin\output to your desired web application directory
- run the web.cmd file as administrator, wait for it to finish and close it (Ctrl+C and y)
- create a new application in IIS and set the physical path to the wwwroot in the web application directory
- make sure the site you're adding it to has a binding with port 5000
- go to the application settings and change the value of
dnx clr
toclr
and the value ofdnx-version
to1.0.0-rc1
- in the same window, add all the configuration settings
- navigate to the WopiHost folder and run
Running the application only makes sense with a WOPI client as its counterpart. WopiHost is compatible with the following clients:
- Office Online Server 2016 (deployment guidelines)
- Office Online https://wopi.readthedocs.io/en/latest/
Note that WopiHost will always be compatible only with the latest version of OOS because Microsoft also supports only the latest version.
The deployment of OOS/OWA requires the server to be part of a domain. If your server is not part of any domain (e.g. you're running it in a VM sandbox) it can be overcame e.g. by installing DC role. After it's deployed you can safely remove the role and the OWA server will remain functional.
To test your OWA server follow the instructions here.
To remove the OWA instance use Remove-OfficeWebAppsMachine
.
In the past (in Office Web Apps 2013), some actions required support of MS-FSSHTTP protocol (also known as "cobalt"). This is no longer true with Office Online Server 2016. However, if the WOPI client discovers (via SupportsCobalt property) that the WOPI host supports cobalt, it'll use it as it's more efficient.
If you want to make the project work with Office Web Apps 2013 SP1 (deployment guidelines), you'll need to create a NuGet package called Microsoft.CobaltCore.15.0.0.0.nupkg containing Microsoft.CobaltCore.dll. This DLL is part of Office Web Apps 2013 / Office Online Server 2016 and its license doesn't allow public distribution and therefore it's not part of this repository. Please make sure your OWA/OOS server and user connecting to it have valid licenses before you start using it.
- Locate Microsoft.CobaltCore.dll (you can find it in the GAC of the OWA server):
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.CobaltCore\
- Install NuGet Package Explorer
- Use .nuspec located in the Microsoft.CobaltCore folder to create new package
- Put the .nupkg to your local NuGet feed
- Configure Visual Studio to use your local NuGet feed
Note: the Microsoft.CobaltCore.dll targets the full .NET Framework, it's not possible to use it in an application that targets .NET Core.
TODO
TODO
There is plenty of space for improvements in the overall architecture, implementation of the [MS-*] protocols or just finishing the TODOs in the code. Lot of refactoring still needs to be done and also the code style has to be unified. So please feel free to help me out with it :)
- Check out open issues
https://msdn.microsoft.com/en-us/library/ms229042(v=vs.110).aspx
- LICENSE.txt - License for my part of the project
- ORIGINAL_WORK_LICENSE.txt - License for Marx Yu's part of the project. This project is based on Marx Yu's project.
- NOTICE.txt - additional notes to how the licenses are applied
If this project helped you and you want to support its further development, please consider donating an amount of your choice. Thank you!
3PuqLrSsV4EFFr55brj9cSJVoaRoc23b3p |
- !!! NEW & SUPERCOOL Documentation: https://wopi.readthedocs.org/
- http://blogs.msdn.com/b/officedevdocs/archive/2013/03/20/introducing-wopi.aspx
- http://blogs.msdn.com/b/scicoria/archive/2013/07/22/building-an-office-web-apps-owa-wopi-host.aspx
- https://code.msdn.microsoft.com/office/Building-an-Office-Web-f98650d6
- https://github.com/OfficeDev/PnP-WOPI + video https://www.youtube.com/watch?v=9lGonu0eoGA
- https://msdn.microsoft.com/en-us/library/dd956775(v=office.12).aspx
- https://channel9.msdn.com/Events/Open-Specifications-Plugfests/Redmond-Interoperability-Protocols-Plugfest-2015/FSSHTTP-File-Synchronization-over-HTTP
- Content roadmap for Office Web Apps Server
- http://www.asp.net/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api
- https://weblog.west-wind.com/posts/2009/Feb/05/Html-and-Uri-String-Encoding-without-SystemWeb
- http://blogs.msdn.com/b/scicoria/archive/2013/06/24/office-web-apps-wopi-host-and-url-paths.aspx
- http://weblogs.asp.net/imranbaloch/k-kvm-kpm-klr-kre-in-asp-net-vnext