Comments (16)
I don't have any refit stub classes in that project (they're all in a different one that is referenced in this one) so I'm not sure why the generator is trying to check all these.
We don't know up-front which projects use Refit and which don't, that's why we have to run the generator :)
Does the build run locally?
from refit.
The solution builds both locally (in visual studio and when I run msbuild on the command line) and in teamcity but when I run the project that I want to deploy (i.e. the main website project rather than the other projects that the website project references) I get the same error
from refit.
It's worth noting that the website project has a reference to refit, but it's only used when I'm referencing the RestService.For() method when building an ioc container. In this case:
container.RegisterSingle<IReconApi>(() => RestService.For<IReconApi>(ConfigurationManager.AppSettings["ApiUrl"]));
as I'm passing it into a few service constructors.
from refit.
Is TeamCity running package restore?
from refit.
No, package install.
Also, the website project isn't building locally by itself. The entire solution builds fine.
from refit.
Also, the website project isn't building locally by itself. The entire solution builds fine.
I don't understand this at all
from refit.
So... I run the following: msbuild solution.sln
and it compiles. No problem.
The website project within the same solution: msbuild Website\website.csproj
and it fails with the following error:
"E:\Dev\secure\src\Website\Website.csproj" (default target) (1) -> (PreBuildEvent target) -> C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131,5): error MSB3073: The command ""..\packages\refit.2.1.0\tools\InterfaceStubGenerator.exe" E:\Dev\secure\src\Website\RefitStubs.cs" "App_Start\IoC.cs;App_Start\LessTransform.cs;App_Start\RouteConfig.cs;App_Start\BundleConfig.cs;Classes\BundleHelper.cs;Classes\FormHelper.cs;Controllers\CallbackController.cs;Controllers\T101AsyncController.cs;Models\ConfirmationViewModel.cs;Orchestrators\ISecurePaymentOrchestrator.cs;Controllers\SecureController.cs;Orchestrators\SecurePaymentOrchestrator.cs;Controllers\T101Controller.cs;Global.asax.cs;Models\PaymentViewModel.cs;Properties\AssemblyInfo.cs"" exited with code 3. [E:\Dev\secure\src\Website\Website.csproj]
I've checked all the file paths and they're correct and I'm wondering if there's something in the stub generator exe that's breaking it. Or if there's something that I'm unintentionally not allowing the stub generator to do
from refit.
The website project within the same solution: msbuild Website\website.csproj and it fails with the following error:
This fails because MSBuild doesn't provide $(SolutionDir)
when you compile from something that isn't a solution. Nothing we can do about it because packagedir is always found relative to the solution
from refit.
I ran into this limitation on a project and found that you can work around it by manually setting the $(SolutionDir)
property as part of the command:
msbuild /property:SolutionDir="%CD%\\" Website\website.csproj
Assuming you are running the command from the solution directory. If not, use any other full path (with trailing slash).
from refit.
I'm actually getting this error when building from the solution
from refit.
@leojh Can you paste in the error you're seeing here?
from refit.
@paulcbetts, I'm seeing the exact same error posted above. My client's solution file may just be truly messed up. It's a hotchpotch of different types of projects in different languages, etc. So it's probably that.
from refit.
Could be an unrelated error - that's just a generic error you'll get in VS any time InterfaceStubGenerator.exe
fails. Can you try running the command at the command line (you'll need to clean up the quoting to make it work) and give us a dump of the exact error.
from refit.
I'm having this problem too on appveyor with an Azure Cloud Project.
Notice the Undefined/projects. I'm guessing SolutionDir isn't available too? Can we fix this?
from refit.
Having similar issue with building in visual studio locally
The command ""C:\Users\Oleh_Kosiakov\Documents\Source\Repos\TRVD\Src\packages\refit.2.4.1\build\portable-net45+netcore45+wp8+wpa81+monoandroid+xamarin.ios10....\tools\InterfaceStubGenerator.exe" "obj\Debug\RefitStubs.g.cs" "C:\Users\Oleh_Kosiakov\Documents\Source\Repos\TRVD\Src\Epam.GuestGuide.Core" "obj\Debug\RefitParams.rsp"" exited with code 1. Epam.GuestGuide.Core C:\Users\Oleh_Kosiakov\Documents\Source\Repos\TRVD\Src\packages\refit.2.4.1\build\portable-net45+netcore45+wp8+wpa81+monoandroid+xamarin.ios10\refit.targets 33
from refit.
This is a very old version. Please try the latest and open a new issue if there's still a problem. Thanks.
from refit.
Related Issues (20)
- [Bug]: Naming the interface to end with "Client" will result in an error during injection.
- Generated code should use `Array.Empty` or constant field where possible HOT 1
- [Bug]: Failed to generate generated classes in Azure Devops with Refit version 6.3.2 and 7.0.0
- Suggestion: run code cleanup/formatter HOT 1
- Target .NET 8 in Refit HOT 4
- Make fullstack C# development easier
- Add handlers to the interface method parameters and headers before generating the HttpRequestMessage
- [Bug]: POST request sent as GET HOT 9
- [Bug]: Long-lived HttpClient instance despite use of IHttpClientFactory HOT 1
- [Bug]: HttpClients not disposed
- [Bug]: Request streams get disposed and there is no option to avoid it
- Source generator for minimal API
- [Bug]: Cannot set the Content-Type header for a POST request HOT 2
- [Bug]: Refit Does Not Generate Implementations if 3+ Interfaces Share a Name HOT 1
- [Bug]: exception with TrimMode full: "URL /path/{id} has parameter id, but no method parameter matches"
- Dependency Dashboard
- [NiceToHave]: Interface `IApiResponse<out T>` misses `[MemberNotNullWhen(true, nameof(Content))]` attribute
- [Bug]: Using `Refit.HttpClientFactory` with a .Net 8 Blazor Web App HOT 5
- Ability to more simply configure a scoped authorization token
- Support [ValueConvertion] attribute HOT 4
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 refit.