Comments (15)
from refitter.
REFITTER000 System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Systém nemůže nalézt uvedený soubor.
I tried to install package Microsoft.Bcl.AsyncInterfaces, but it did not help. VS 2022, MAUI app project. Thanks for help
I have run into exactly the same problem on compiling, but it seems not be MAUI related (or, at least, not exclusively), because my project was a Web API and the build error occurred when building a class library, which was the project the nuget package was added to.
from refitter.
REFITTER000 System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Systém nemůže nalézt uvedený soubor.
I tried to install package Microsoft.Bcl.AsyncInterfaces, but it did not help. VS 2022, MAUI app project. Thanks for helpI have run into exactly the same problem on compiling, but it seems not be MAUI related (or, at least, not exclusively), because my project was a Web API and the build error occurred when building a class library, which was the project the nuget package was added to.
@manuel-fernandez-rodriguez Interesting... I primarily use this myself on Web API (Minimal API) projects. What version of .NET do you target and what version of Refitter do you use?
I just put this little Minimal API project together to test it out: MinimalApi.zip
I could build and run it without any issues
I have downloaded the zip, and the openapi definition for the PetStore was missing, so I downloaded it from https://petstore3.swagger.io/api/v3/openapi.json.
The Refit interface was successfully generated, but I get exactly the same error that we have been mentioning from the start:
Build started at 20:44...
1>------ Build started: Project: MinimalApi, Configuration: Debug Any CPU ------
1>CSC : error REFITTER000: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
1>Done building project "MinimalApi.csproj" -- FAILED.
Surprisingly, if I build it from the command line:
> dotnet build
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
MinimalApi -> C:\Users\mfernandezr\Downloads\MinimalApi\bin\Debug\net8.0\MinimalApi.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:08.75
So I have to presume the problem is not the code itself, but something related to Visual Studio or its interaction with the code generation.
My Visual Studio version is:
Microsoft Visual Studio Enterprise 2022 (64-bit) - Current
Version 17.8.3
And I have the following SDK and runtimes installed:
> dotnet --list-sdks && dotnet --list-runtimes
8.0.100 [C:\Program Files\dotnet\sdk]
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]```
from refitter.
I released a preview version to NuGet
<PackageReference Include="Refitter.SourceGenerator" Version="0.8.6.38-preview" />
It works for me in my Visual Studio setup. Can you also try it on your machines @manuel-fernandez-rodriguez @folbrecht ?
from refitter.
@christianhelle
Checked and, apparently it works flawlessly when building :)
Thank you SO much for the quick workaround.
from refitter.
@folbrecht thanks for taking the time to report this.
I haven't tried using Refitter with a MAUI project, but I'll try that myself over the weekend and see if I can reproduce it, and even better, see what could be wrong...
As a workaround, have you tried using the Refitter CLI tool?
from refitter.
@all-contributors please add @folbrecht for bugs
from refitter.
I've put up a pull request to add @folbrecht! 🎉
from refitter.
@folbrecht I could easily reproduce your problem, but I haven't figured out why this happens with MAUI projects.
One good thing is that Refit itself works fine with MAUI but the Refitter.SourceGenerator
package reference is causing the problems.
As a workaround, you can remove the Refitter.SourceGenerator
package reference and add the Refit
package reference. Then you can keep the generated file as it is or re-generate it using the Refitter CLI tool
My schedule is a bit packed these days leading up to the holidays. I'll eventually, and hopefully, figure out what's wrong when working with MAUI, and work on a fix for the problem. Until then, I apologize for the inconvenience and the delays
from refitter.
REFITTER000 System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Systém nemůže nalézt uvedený soubor.
I tried to install package Microsoft.Bcl.AsyncInterfaces, but it did not help. VS 2022, MAUI app project. Thanks for helpI have run into exactly the same problem on compiling, but it seems not be MAUI related (or, at least, not exclusively), because my project was a Web API and the build error occurred when building a class library, which was the project the nuget package was added to.
@manuel-fernandez-rodriguez Interesting... I primarily use this myself on Web API (Minimal API) projects. What version of .NET do you target and what version of Refitter do you use?
I just put this little Minimal API project together to test it out:
MinimalApi.zip
I could build and run it without any issues
from refitter.
@manuel-fernandez-rodriguez Thanks for all the input! This will be very helpful.
My excuse for not running into this - I spend most of my day in JetBrains Rider and the CLI 😞
I'll see what I can do
from refitter.
@manuel-fernandez-rodriguez Good news is that I found the line of code that throws an exception. The bad news is that I don't understand why it does, and why it doesn't...
For now, I think I'll add a try/catch around the deserialization code in the source generator project and just jump out if anything unexpected happens
from refitter.
@all-contributors please add @manuel-fernandez-rodriguez for bugs
from refitter.
I've put up a pull request to add @manuel-fernandez-rodriguez! 🎉
from refitter.
@folbrecht I tested the latest release preview on a new MAUI app and it seems to work fine.
I'm closing this
from refitter.
Related Issues (20)
- Already defines a member with the same parameter types HOT 8
- `operationNameGenerator` enum not resolved from .refitter file HOT 2
- Add support for old core frameworks versions from .net6 HOT 5
- More than one generated Client Api will result in an Extension Method Conflict for ConfigureRefitClients HOT 6
- IAsyncEnumerable - JSONL/application/x-ndjson HOT 7
- Hyphens with JsonStringEnumConverter results in `JSON value could not be converted` HOT 7
- Response is always nullable under `generateNullableReferenceTypes` HOT 2
- Source generator does not work in .Net 8 HOT 1
- Support for OpenAPI version 3.1.0 HOT 2
- Non string/boolean CodeGeneratorSettings are not honored HOT 3
- Generate the client from multiple versions HOT 1
- `remove-unused-schema` not working for collection-type responses HOT 1
- Asana API "cannot derive from sealed type" HOT 4
- Code Generator creates unsafe interface method names HOT 1
- Code Generator adds numeric suffix to Interface method name when not needed HOT 3
- Add the facility to exclude namespaces from generated code HOT 5
- Asana API specs strange naming HOT 2
- Refit Fails on Jira OpenAPI specs HOT 5
- Serializer improvements HOT 1
- All Contributors Bot HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refitter.