workbook cannot be opened when trying to integrate office web app in mvc - asp.net-mvc

I have been following this tutorial to open office web apps online but when I click URL generated by selecting the excel file I get error
workbook cannot be opened
you may test here to check the issues
Discovery.xml file is taken from HERE production environment and code is hosted on my own server

You can't just take the discovery file from the WOPI docs. As the docs say:
These URLs are publicly accessible. However, you will not be able to invoke any WOPI actions successfully unless your WOPI domain has been added to the WOPI domain allow list.
The discovery file contains URLs to a working WOPI client instance. This needs to be either Office Online with your domain added to white-list or an on-premise instance of the Office Online Server. Here's how to install it locally. Then, fetch the discovery file from your instance.

Related

Delphi file dialog won't handle Sharepoint urls [duplicate]

I'm not sure how to phrase this question, but it's my understanding that a sharepoint run website (such as a business's intranet) can be mapped to a network drive. You could theoretically access that drive and get documents from it OR upload documents to that drive and it would update the sharepoint run website with the new document.
I have no experience with this and it seems like a very neat thing to do. I only have some experience with creating sharepoint webpages and some security regarding those webpages (so, not very advanced).
How do I go about enabling sharepoint webpages to do this? I don't really even know what to look up.
If a SharePoint site is accessible to employees, they can map a drive letter to the UNC filepath of a SharePoint site, library, or folder.
The UNC path requires dropping the http protocol prefix and flipping all forward slashes to backslashes.
For example, if you have a SharePoint library that can be accessed at http://contoso.sharepoint.com/mycoolsite/mycoollibrary, users can map a drive letter to \\contoso.sharepoint.com\mycoolsite\mycoollibrary to open that library in Windows Explorer.
Accessing a SharePoint site via Windows Explorer does require the WebClient service to be running on the user's computer. It uses the WebDAV publishing model to treat SharePoint directories as if they were PC folders. This service does have some limitations that you wouldn't run into when using SharePoint in the browser. For example, by default it can only move files up to 50Mb; this is a registry setting on the user's computer, not a SharePoint limitation.
Note that users do not need to map a drive letter to use this functionality; they can navigate to \\contoso.sharepoint.com\mycoolsite\mycoollibrary in Windows Explorer directly. Mapping a drive is sort of equivalent to bookmarking the location for easy access.

How can I publish/upload ASP.NET MVC 5 Website

I have never published an ASP.NET MVC website to a hosted server. I have read and followed instructions and failed with publishing from Visual Studio directly to the hosted server. I used FTP publish method, provided required credentials, then published the website successfully. When I do this, I get the error when I try to access the website:
500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
I thus followed another instruction to publish to a local folder, using File System method, then uploaded the contents of that local folder using ftp to the hosted server. This gives me this error when I try to access the website:
Server Error
403 Forbidden
You do not have permission to access this document.
I would have loved the second method to work, but looking at the folder content, I can see some folders like App_Start missing, which I know is where start up pages are managed from, so I am not sure whether this is a proper procedure.
I would love some advice on how to publish this website. It would also be great to find a way that will allow updating changes, instead of publishing the entire website whenever changes are made.
I am using VS2019, and a .net hosting provider, not Azure.
Thank you!
In most case you can't see App_Start but all can working fine, you should find httpdocs it's the destination folder that you need to use to copy your files.
You can also try web deploy in your visual studio.
To make it work correctly you need to get the setup file from your hosting provider, with this you don't need to update always all files by ftp, and if you are lucky (if you have Database rights) you can also auto-update your database.
Don't forget also to check your web.config if you use a database connection.
Please try this two methods then if you need more help I will edit.

How to publish to azure

I have an mvc application thats built using the repository pattern. My Database resides in the SmokersTavern.Data folder. I have published the site to azure. On startup the user must logon thereof will be redirected to the Products table. However I get the following error.
It is not allowed to connect to local database when your web app has been published to Azure.
You should create an Azure sql database and connect to it instead. Here's the tutorial for you to refer.
You need to create an Azure resource group deployment project with your Visual Studio web application so that Visual Studio knows where to publish your code. Please take a look at this:
Creating and deploying Azure resource groups through Visual Studio
Although, you are using the 'Publish to Azure' feature, I don't see the resource group configuration in the Solution Explorer pane on the right (based upon the screen capture you provided).
Following this document will walk you through the set-up, configuration, and publishing of your web application to Azure.
I created the app service + sql and in my visual studio I connected to app service created on Azure. My connection string in my config file was not that of the Azure sql db

404 error on azure for Asp.Net Web Api Project

I have deployed exact same solution on two servers, one is my own server in my basement and the other one is Microsoft Azure. The project is developed using Asp.Net Web Api 2.
On my own windows server running IIS 8.5 it totally works. For test, you can simply browse this link in your browser and see the error message {"Message":"The requested resource does not support http method 'GET'."} which shows the API has been hit.1
But exact same project on my Azure domain here, you just get a message saying
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
Everything about these two deployments is the same (to the best of my knowledge) and I was wondering if there is any further steps necessary on Web Api app deployment in MS Azure which I am missing.
I finally found the answer to this issue. If there are multiple apps deployed as one single website so each app is located in its own subfolder, you have to go to the configuration section of your web app on Azure and create virtual directories for each of those sub folders.
Ah, my problem was probably a common one. I was using
rootconfig = System.Web.Configuration.WebconfigurationManager.OpenWebConfiguration(null);
and that was returning the root web because the parameter was null.
When I ran it local that worked fine, but after I deployed the root Config was NOT what I wanted and my code was failing.
Switched to direct access via
stringVal = WebconfigurationManager.AppSettings["Foobar"].ToString();
Nice. Plus less overhead.

403 - Forbidden: Access is denied. ASP.Net MVC [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden
I published my application on server. When I enter my domain i got this error:
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.
What's happend?
Are you hosting the site on iis? if so make sure the account your website runs under has access to local file system?
Straight from msdn .....
The Network Service account has Read and Execute permissions on the IIS server root folder by default. The IIS server root folder is named Wwwroot. This means that an ASP.NET application deployed inside the root folder already has Read and Execute permissions to its application folders. However, if your ASP.NET application needs to use files or folders in other locations, you must specifically enable access.
To provide access to an ASP.NET application running as Network Service, you must grant access to the Network Service account.
To grant read, write, and modify permissions to a specific file
In Windows Explorer, locate and select the required file.
Right-click the file, and then click Properties.
In the Properties dialog box, click the Security tab.
On the Security tab, examine the list of users. If the Network Service
account is not listed, add it.
In the Properties dialog box, click the Network Service user name, and in
the Permissions for NETWORK SERVICE
section, select the Read, Write, and
Modify permissions.
Click Apply, and then click OK.
Click here for more
In addition to the answers above, you may also get that error when you have Windows Authenticaton set and :
IIS is pointing to an empty folder.
You do not have a default document set.
I just had this issue, it was because the IIS site was pointing at the wrong Application Pool.
I had the same issue (on windows server 2003), check in the IIS console if you have allowed ASP.NET v4 service extension (under IIS / ComputerName / Web Service extensions)

Resources