Skip to content

Getting started instructions #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
LeonGorbaty1 opened this issue Jul 2, 2020 · 13 comments
Open

Getting started instructions #6

LeonGorbaty1 opened this issue Jul 2, 2020 · 13 comments

Comments

@LeonGorbaty1
Copy link

Please add a readme or some text at the front of the repo with steps to test the add-in in Word?

manuelsidler pushed a commit that referenced this issue Jul 2, 2020
@manuelsidler
Copy link
Owner

I've just added a short instruction (see commit above). Could you verify if it works for you @LeonGorbaty1 ?

@LeonGorbaty1
Copy link
Author

@manuelsidler it mostly worked THANK YOU !!! I had a few issues, consider adding the following:

  • Make sure that the Guid in the manifest matches the Guid in the registry (the sideloading instructions suggest you generate a new guid, so I did, and then added that new one in the manifest node
  • Make sure the registry edit takes - I had to do it twice and reboot once for it to show in Regedit for some reason
  • In Office app (Word in my instance) if you get "We can't open this add-in from localhost" then
    a) Make sure your server is running (doh :-))
    b) See fix here https://docs.microsoft.com/en-us/office/troubleshoot/office-suite-issues/cannot-open-add-in-from-localhost

I also got a JSException here
var autoShowAddIn = await JSRuntime.InvokeAsync<bool?>("window.Office.context.document.settings.get", "Office.AutoShowTaskpaneWithDocument");
but that's ok, the add-in is running and I am able to hit breakpoints and debug in VS ... I can work from here...

THANKS AGAIN !!

@kondzikwawa
Copy link

kondzikwawa commented Oct 23, 2020

Hi, I still experience problem with my Add-in. When I run Word I can't see both host and name - only "Not in Office.". It looks there is a problem with connection between Word and Add-in. When I put a break point in this line "await JSRuntime.InvokeVoidAsync("wordWrapper.saveDocumentMetadata", _documentMetadata);" in OnAfterRenderAsync and turn on Add-in in Word the debugging doesn't stop... I would be grateful for any idea or tip. Many thanks in advance.

@manuelsidler
Copy link
Owner

Which .NET Core version are you using?

@kondzikwawa
Copy link

Many thanks for reply. I'm using .Net Core 3.1
I've tried on two machines and unfortunately the same problem. Do you see anything wrong in attached screenshots and manifest?
RegEdit
DotNetVersion
manifest.txt

@kondzikwawa
Copy link

Regarding to my previous comment. Any idea what can be wrong with my add-in?
Thanks in advance for help.

@manuelsidler
Copy link
Owner

Sorry I haven't been able to take a look into your problem. I'll try to find some time this week.

Do you see any errors in the Edge DevTools console? https://docs.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-using-f12-developer-tools-on-windows-10#debug-using-microsoft-edge-devtools

@kondzikwawa
Copy link

kondzikwawa commented Dec 7, 2020

Hi, apologize for delay. I've been extremely busy for last couple of weeks.
So yes I can see an issue during the Office.Initialize and it breaks the app. If you can take a look and let me know if you have any idea I'd be grateful. Thanks in advance.
issue

And exception which I can see in Visual Studio:
{"Could not find 'initialize' in 'window.Office'.\nError: Could not find 'initialize' in 'window.Office'.\n
at https://localhost:44385/_framework/blazor.server.js:8:30944\n
at Array.forEach ()\n
at p (https://localhost:44385/_framework/blazor.server.js:8:30904)\n
at https://localhost:44385/_framework/blazor.server.js:8:31614\n
at new Promise ()\n
at e.beginInvokeJSFromDotNet (https://localhost:44385/_framework/blazor.server.js:8:31587)\n
at https://localhost:44385/_framework/blazor.server.js:1:20052\n at Array.forEach ()\n
at e.invokeClientMethod (https://localhost:44385/_framework/blazor.server.js:1:20022)\n
at e.processIncomingData (https://localhost:44385/_framework/blazor.server.js:1:18006)"}

@manuelsidler
Copy link
Owner

Based on your screenshot, it seems like you try to run the add-in directly in a browser instead of the office application?

Could you try to sideload your add-in in Office based on the official documentation?

https://docs.microsoft.com/en-us/office/dev/add-ins/testing/create-a-network-shared-folder-catalog-for-task-pane-and-content-add-ins

@kondzikwawa
Copy link

Thanks for reply. Yes, in Visual Studio I click IIS Express and then I can see my add-in in browser, but when I open the Word and open my add-in I can see the proper taskpane...however is not working properly, host and platform are blank and buttons are not working. More over if I insert break points in VS, the code doesn't stop if I click e.g. buttons directly from add-in in Word...but when I click any button in browser breakpoints are working normally.
image

Maybe I do something wrong...

@manuelsidler
Copy link
Owner

With Office add-ins, it's not possible to hit F5 and debug straight away. If you want to debug the client-side code, you have to attach the Edge developer tools to your add-in as described here:
https://docs.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-using-f12-developer-tools-on-windows-10#debug-using-microsoft-edge-devtools

You can also try to attach Visual Studio directly to your Office add-in as described here:
https://docs.microsoft.com/en-us/office/dev/add-ins/testing/attach-debugger-from-task-pane

@kondzikwawa
Copy link

Ok, I get it it's not straightforward but I think there is a problem with Office.js and I have no idea why.
image
Is not loaded so that's the reason why I can't see the host and platform.
But of course I've included Office.js in my _Host.cshtml file:
image
And of course I have "Initialize" and "onready" in my code.
image

Many thanks for your help.

@HansenBerlin
Copy link

HansenBerlin commented Mar 7, 2021

Ok, I get it it's not straightforward but I think there is a problem with Office.js and I have no idea why.
Is not loaded so that's the reason why I can't see the host and platform.
But of course I've included Office.js in my _Host.cshtml file:
And of course I have "Initialize" and "onready" in my code.

Many thanks for your help.

Did you find a solution? Same problem here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants