Skip to content
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

Unable to load assembly depending on Kiota or kiota dll. #500

Open
thompson-tomo opened this issue Dec 24, 2024 · 7 comments
Open

Unable to load assembly depending on Kiota or kiota dll. #500

thompson-tomo opened this issue Dec 24, 2024 · 7 comments
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question

Comments

@thompson-tomo
Copy link
Contributor

thompson-tomo commented Dec 24, 2024

My application leverages a plugin architecture where in which dll's can be dynamically added to the application for different integrations. These plugins are loaded using "Assembly.LoadFile" however when it attempts to load Microsoft.Kiota.* (excluding the abstractions) package it will fail to load as can't get the types. It will also cause any library dependent on Microsoft Kiota to also fail resulting in my plugin not being loadable.

The exception i am encountering is:
Message:

{"Unable to load one or more of the requested types.\r\nCould not load file or assembly 'Microsoft.Kiota.Http.HttpClientLibrary, Version=1.16.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified."}

StackTrace

   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at Skidata.Dashboard.Connector.ConnectorResolver.LoadConnector[T1](List`1 options, String folder) in C:\Users\thja\Documents\Repos\dashboard\interface\panel-connector\src\Skidata.Dashboard.Connector\ConnectorResolver.cs:line 27

Loader Exceptions

{"Could not load file or assembly 'Microsoft.Kiota.Http.HttpClientLibrary, Version=1.16.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.":"Microsoft.Kiota.Http.HttpClientLibrary, Version=1.16.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

Application is being compiled for dotnet 8
libary: 1.16.1

@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Dec 24, 2024
@baywet
Copy link
Member

baywet commented Dec 24, 2024

Hi @thompson-tomo
Thank you for using kiota and for reaching out.

I'd like to mention that we're operating with a reduced team at the moment, expect delays in responses, thank you for your patience!

Can you ensure the dll is present with the deployment and in the expected location for your assembly loading implementation to find it please?

Do you have other modules that depend on additional dependencies and are loading fine? Can you compare the references of the package (and the copy mechanisms)

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question labels Dec 24, 2024
@baywet baywet moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Dec 24, 2024
@thompson-tomo
Copy link
Contributor Author

No worries especially as I am also on leave atm.

Yes I can confirm file is present in the folder and In fact to achieve the plugin architecture I am scanning the configured folder for all dll's which is how I determine what could be loaded. With the folder being a clone of publish output.

What I found is that the abstraction lib will load without issue but not the others. At the same time Std.UriTemplate has no issue loading. One of my other plugin is operating without issue with a dependency on Brainboxes.IO.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Dec 24, 2024
@baywet
Copy link
Member

baywet commented Dec 24, 2024

Thank you for the additional information.

Is http client the only one that doesn't load? or do you also have issues with serialization JSON/Text/Form/Multipart?

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Dec 24, 2024
@thompson-tomo
Copy link
Contributor Author

Also issues with serilaztion. I have a dependency on the bundle & only abstractions will load everything else fails.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Dec 24, 2024
@baywet
Copy link
Member

baywet commented Dec 27, 2024

Thank you for the additional information.

Does the issue happens only in production? or also when you try to debug the application in the IDE? (the linkage is a bit different between the two)

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Dec 27, 2024
@thompson-tomo
Copy link
Contributor Author

Issue Also occurs when running my app in the visual studio debugger. Note I have tried to load both the published output & also the bin output but same result.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Dec 28, 2024
@baywet
Copy link
Member

baywet commented Dec 30, 2024

Thank you for the additional information.

Is your app using any trimming? are the hashes of the dlls in the source package and the published result the same? (trying to check whether anything might have been tempered by a custom build process here)

Are you able to share a minimal reproduction repository?

Thanks!

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question
Projects
Status: Waits for author 🔁
Development

No branches or pull requests

2 participants