Office365上的提供商托管应用程序返回404 NOT FOUND错误 [英] Provider hosted app on Office365 returns 404 NOT FOUND error

查看:108
本文介绍了Office365上的提供商托管应用程序返回404 NOT FOUND错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我尝试创建一个简单的提供者托管应用程序,点击按钮,显示网站名称和当前登录用户。

I tried creating a simple provider hosted app which on button click, displays the Site name and the current logged in user.


如果我在Visual Studio 2013的调试模式下使用应用程序,该应用程序运行正常。但是当我在AWS中部署.net代码并使用应用程序时(删除调试.app包后)我得到"404 not found" ;错误。

The app is working perfectly if i use the app in debug mode from Visual Studio 2013. But when i deploy the .net code in AWS and use the app ( after removing the debug .app package) i am getting "404 not found" error.


应用链接如下:... / appredirect.aspx?instance_id = {A4ADC690-6B94-46B3-8524-A2D66B9850FA}& quick_launch = 1

App link is as follows:.../appredirect.aspx?instance_id={A4ADC690-6B94-46B3-8524-A2D66B9850FA}&quick_launch=1


我的博客:http://sharepointr.com - ZedProg Profile

My blog: http://sharepointr.com - ZedProg Profile

推荐答案

您好,您如何在Sharepoint中注册您的应用程序:通过应用程序目录> Sharepoint应用程序或通过AppRegNew.aspx / AppInv.aspx?你说你删除了调试应用程序包,所以可能你使用的是App目录。在这种情况下,您需要将发布应用
包上传到App catalog> Sharepoint应用程序。当您在Visual Studio中打包应用程序清单时,您需要指定2个参数:

hello, how you register your app in Sharepoint: via App catalog > Apps for Sharepoint or via AppRegNew.aspx/AppInv.aspx? You said that you removed debugging app package, so probably you use App catalog. In this case you need to upload your release app package to App catalog > Apps for Sharepoint. When you will package the app manifest in Visual Studio you need to specify 2 parameters:

- app url(https:// {your web app name} .azurewebsites.net /)

- 客户ID为

- app url (https://{your web app name}.azurewebsites.net/)
- client id

即此时您应该已经在Azure中创建了Web应用程序 - 这将是您应用程序的起始页面。如果您要检查app.manifest的代码,将会有属性StartPage,如下所示:

I.e. at this moment you should already have created web app in Azure - this will be the start page of you app. If you will check code of app.manifest there will be property StartPage which may look like this:

<StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>

StartPage正是在点击Sharepoint中的应用程序图标后用户将被重定向的页面。因此,为了避免404,您需要确保Web应用程序已经存在,并且在创建应用程序包时指定了正确的URL。

StartPage is exactly the page where user will be redirected after clicking on app icon in Sharepoint. So in order to avoid 404 you need to ensure that web app already exists and that you specify correct url when create app package.

此外,您还需要拥有客户端ID:您可以从AppRegNew.aspx通过生成新的客户端ID和密码。在此页面上,您还需要指定应用程序域和站点 - 使用创建应用程序包时使用的相同Web应用程序名称(https:// {your web
app name} .azurewebsites.net /)。不要忘记存储生成的cliend id和secret。您需要在Azure网站中存储的web.config中的ClientId和ClientSecret应用程序设置键中指定它们。

Also you need to have client id: you can get it from AppRegNew.aspx by generating new client id and secret. On this page you also need to specify app domain and site - use the same web app name which will be used when create app package (https://{your web app name}.azurewebsites.net/). Don't forget to store generated cliend id and secret. You need to specify them in ClientId and ClientSecret app settings keys in web.config stored in Azure web site.

创建应用程序包后,您有2个选择取决于您的方案:

After you have created app package you have 2 choices depending on your scenario:

- 以管理员的方式自行将应用程序部署到目标网站集,因此它将自动为所有用户提供。为了首先在App目录上执行此操作,请转到"站点内容">添加应用>查找并安装您的应用。在
之后,当你将鼠标悬停在app图标上时,会在菜单中点击,你会发现几个链接:关于,权限,部署,删除。您必须选择部署链接,并在打开的页面上添加应添加
应用程序的网站集的网址

- deploy app to the target site collection by yourself as admin in centralized way, so it will be available for all users automatically. In order to do that at first on App catalog go to Site contents > Add an app > Find and install your app. After that when you will hover the mouse over app icon there will be ... in menu by clicking which you will find several links: About, Permissions, Deployment, Remove. You have to choose Deployment link and on opened page add urls of site collection(s) to which your app should be added

- 决定将应用程序添加到最终用户 - 在这种情况下,用户需要转到网站内容>添加应用并自行添加应用。

- leave decision to add the app to end users - in this case users will need to go to Site contents > Add an app and add app by themselves.

部署(任何描述的方法)后,应用图标将显示在网站集>网站内容以及当您点击它时,它应该显示应用页面。

After deployment (any of the described methods) app icon will appear in site collection > Site content and when you will click it it should show you the app page.

还要检查以下文章,该文章基本相同:  当您的应用在SharePoint 2013中需要AppRegNew.aspx时

Check also the following article, which says basically the same: When Do Your Apps Need AppRegNew.aspx in SharePoint 2013.


这篇关于Office365上的提供商托管应用程序返回404 NOT FOUND错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆