Coder Social home page Coder Social logo

Comments (23)

davidchesnut avatar davidchesnut commented on July 29, 2024

Hi @mvegaca,

Looks like the add-in loads and shows you a list of attachments. And then it fails when you attempt to save them. It's most likely something to do with the app registration. I'd double-check all the readme steps to be sure the app registration was set correctly. Also make sure the AttachmentsDemo.xml manifest has the correct ID (in both spots) and the web.config has the correct ID and secret value.

If it's still not working we could compare app registration manifests. You can see it in the Azure portal app registration page by choosing Manifest on the left side. I could post a sample working one here to compare with, and it might help spot any issues in the registration.

Hope this helps,
David

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

@mvegaca,

What version of Visual Studio did you use? I tested this using Visual Studio 2022 Preview and this failed for some obscure reason. I then switched to Microsoft Visual Studio Enterprise 2019 Preview Version 16.11.0 Preview 4.0 and that did work properly.

So I see two options:
a) You missed a step in the registration as @davidchesnut also mentioned (there are a lot of steps and it is easy to miss one or two) I recorded my complete test (did not livestream it due to vulnerable Azure info on screen)
b) The VS version is failing.

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

Hi

Yesterday at the end of the day, it works on Outlook Desktop, but stills happen on the web, it was working and the sample saves the attachments files to the sign in account onedrive, it's fine. But it still failing on Google Chrome.
Is it any possibility to specify debug only in outlook for desktop?

I'm using Visual Studio 2019 Community

from office-add-in-samples.

davidchesnut avatar davidchesnut commented on July 29, 2024

Hi @mvegaca,

Okay, yep, if it works in Outlook desktop then your app registration is good. I tested the sample again in Chrome just to be sure something hasn't changed, and it is working.

At this point I'd try some debugging techniques to get some more information.

  • Use the developer debug tools in Chrome to see if there is any output to the console indicating errors or problems loading.
  • Use a network monitor like Fiddler to see if any calls to localhost or Azure sign in services (When running the project in Visual Studio in debug mode) are returning HTTP errors or embedded JSON errors with more information.
  • Set some breakpoints on the API methods in Visual Studio to see if you can hit them and step through the code to find out more.

Thanks!
David

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

Hi David,

This morning i was trying to debug it in chroome and it works! I'm not sure why happens this, but I've observe this fail in other scenario.

I add my app client ID and my app secret, F5 and it works.
I copy the sample folder (removing .vs, packages, bin and obj folders) to a new folder in desktop.
I run the coppied proyect and it fails with the same error on loading (also with Outlook Desktop Client).

Is it possible that I need to remove some cache files to run the code from other location on when I change from Desktop to chrome?

Thanks

from office-add-in-samples.

davidchesnut avatar davidchesnut commented on July 29, 2024

Hi @mvegaca,

Did you do a rebuild on the project in the new folder with no errors? You need the bin folder because it will build the correct manifest for loading there. If you rebuild it should generate the correct bin folders and files.

Thanks,
David

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

Hi,

I keep finding this error even if I work with this sample or creating and debugging a new outlook add-in blank project.

This error is documented here and I'm applying the workaround but the error is still happening.
https://docs.microsoft.com/en-us/office/dev/add-ins/testing/testing-and-troubleshooting

I've no errors if I deploy the web app to an azure app service but I can not debugg the code in this execution way.

from office-add-in-samples.

davidchesnut avatar davidchesnut commented on July 29, 2024

Hi @mvegaca,

If new projects are failing there's definitely something up with the configuration of Outlook on Windows. You should try clearing the Office cache and see if that helps.

BTW: Can you please confirm which version of Outlook you are using? The one listed at the beginning of this thread looks odd as the current version is 16.* not 18.*.

Thanks!
David

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

Hi

I've tried to remove the cache removing the content of cache folders, then run the project again.

Now I have a different error

image

If I close the add-in pane, select a different mail and open the add-in, I've got the load error.

This is the version information
Microsoft® Outlook® for Microsoft 365 MSO (16.0.14326.20164) 64-bit
Microsoft Visual Studio Enterprise 2019 (2) Version 16.11.2

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

I have seen the exact same error while using VS 2022 Preview and rebuilt it did it all over again with 2019 Preview Version 16.11.0 Preview 4.0 and that ran without issues. This was what I posted august 20th. I'll upload the video to YouTube as an unlisted video for @davidchesnut to have a look.

from office-add-in-samples.

davidchesnut avatar davidchesnut commented on July 29, 2024

@aafvstam and @mvegaca thanks for noting this. I've seen this error before and there is a workaround described here: https://stackoverflow.com/questions/32780315/could-not-find-a-part-of-the-path-bin-roslyn-csc-exe However I updated the Nuget package as described in PR #205. Can you give that PR a try and see if it fixes the error for you? I'd like to fix this without requiring a workaround. Thanks!

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

Done, and created a PR #206 on #205 iron out some wrinkles 😉

from office-add-in-samples.

davidchesnut avatar davidchesnut commented on July 29, 2024

@aafvstam awesome! Thanks!

@mvegaca I merged the fixes into the sample, can you confirm if this works for you? Thanks!

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

Hi
I think that the roslyn error is fixed but I still haven issues with the loading error.
image

I hope that it doesn't fail in your machines could be a problem on my dev env.

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

@mvegaca Is that in Outlook Client or Outlook on the Web? Seen the above error before the fix but went away after reloading so it could be a timing issue. Can you try both Web and Client to see what the result is (you can easily switch target as described in README.md:

Select the AttachmentDemo project in Solution Explorer, then choose the Start Action value you want (under Add-in in the properties window). Choose any installed browser to launch Outlook on the web, or you can choose Office Desktop Client to launch Outlook on Windows. If you choose Office Desktop Client, be sure to configure Outlook to connect to the Office or Outlook.com user you want to install the add-in for.

Curious to see if it occurs in both environments.

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

Hi @aafvstam it also fails en web browser (edge and chrome).

image

The code is sync with the repo and the only modifications is for ID a new GUID and adding the Azure App Registration ID and Secret

image

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

A few more questions:

What is your startup property for multi-factor (below the startup option)?
If you right click the taskpane, inspect (open the developer pane) and reload, do you see any specific errors pass by?
Is the user email the same as the Azure App Registration account?
If not is, it on the same Tenant?
Did you see any 'consent' dialogs between startup and the error pane that asks you to confirm access to the account?

Let's see if we can figure it out ... I feel that it is just a small step from the finish line 😉

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

It is annoying the issue was not persistent, I tried on another machine and found the issue one time, after that it worked on every run.

So, I updated all packages in the repo to the latest version and pushed PR #208 in after testing this on Outlook for the Web in Edge and in Chrome. Also tested in Outlook for Office Client on the desktop. Feels much more responsive to me but maybe I'm biased 😉.

@mvegaca Please try it out and let me know how it works at your side.

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

I think the Issue is not related with this sample, is a problem of Outlook Web AddIn template.

I've done the following steps

  • Create a new Outlook Web AddIn project
  • Set manifest file as startup project
  • Set Use multi-factor auth to True
  • Set Start Actio to Office Desktop Client
  • Run the app
  • Do loggin with the loggin promp
  • The outlook client is opened
  • Click on Display all properties button

image

  • The right pane is opened with this error

image

This is the code of the project

OutlookWebAddIn.zip

I've also tried working with outlook add-ins created using VS Code and Yeoman (Javascript and Typescript) and all works fine, I only have this kind of error on Outlook Web AddIns projects created using Visual Studio 2019 Enterprise.

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

The reason for this to fail is that you changed the startup from both projects (Multi Startup) into one project (Single Startup). Only the installation of the Outlook Add-in is started by selecting the Manifest project (OutlookWebAddin) as startup project.

At the time you run the add-in Outlook tries to load the 'website' that should have been served by starting the second project. Because you changed the startup to the Manifest project the website is not served and cannot show you the content.

If you right click the solution and select Properties in VS you should see the startup dialog showing TWO projects are started:

image

The first one (OutlookWebAddinWeb) is serving you the content of the TaskPane and is served like a website.
The second one (OutlookWebAddin) contains the Manifest that tells Outlook how the Ribbon looks like and where to find the website to serve the content (the above website OutlookWebAddinWeb).

Here you can see what the result is from your demo code you included in the OutlookWebAddin.zip
image

Does this make sense and could this also have happened with your original issue? Please check that the Multi Startup option is enabled to be sure that both the Add-in is installed and the Website (hosting your add-in) is running.

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

It makes sense, but It fails with the multiple startup project option, in fact, when I create an Outlook Web AddIn project the generation resulting code is configured to be executed with multiple startup projects and it fails.

This is the result of generating a new Outlook Web AddIn project

image

  • Set multi factor to true
  • Press F5
  • Log In in the loggin prompt
  • Opened in Chrome (it works, mail properties are displayed)
  • Stop de debugging process
  • Set Start Action to office desktop client in the manifest project properties
  • Press F5
  • Opened in Outlook desktop client
  • Fails on loading

image

I hope it helps

from office-add-in-samples.

aafvstam avatar aafvstam commented on July 29, 2024

It is working without issues at my side (as you can also see at my properties image above).

Somehow your "Server" is not serving in the context of your Outlook desktop client, so let's do some more tests.

Set your target to Office Desktop Client and start the application by selecting the Solution and hit F5
This should start both loading the Add-in (manifest project) and start a web server at the port specified here:

image
Properties OutlookWebAddInWeb

Now open your browsers and open URL: https://localhos:44346/MessageRead.html
What do you see? It should show you the below webpage:

image

The properties are obviously not loaded as the webpage is intended to load in the context of the Message. In fact, when you go to Developer Tools you should see the console output "Warning: Office.js is loaded outside of Office client" to prove that.

image

Let me know if your server is working ... and while you are at it, check the certificate for that page, is it valid?

image

If it is, go to Outlook, select a message, and click the Display all properties Button. What do you see?

from office-add-in-samples.

mvegaca avatar mvegaca commented on July 29, 2024

Hi @aafvstam

I've tried this following theses steps

Create a new Outlook Web AddIn Project (VS 2019 Enterprise)

Update Manifest project properties

  • Set Start Action to Office Desktop Client
  • Set Multi-Factor Auth to true

Run with F5

  • Login with company email address
  • It fails on Outlook

Open in browser

The error in outlook specify that the AddIn is not loaded, if I press F12 in the task pane looking for errors in the console it looks that there is no content loaded in the edge instance contained into the taskpane.

image

I've no problems on working with add ins in VS Code and JS.

Is that problem exclusive for my computer? Do you have other issues reporting with that problem?
If it helps I'm opened to share you my screen on a teams call.

from office-add-in-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.