Giter Site home page Giter Site logo

Comments (16)

anaisbetts avatar anaisbetts commented on May 5, 2024

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.

pierskarsenbarg avatar pierskarsenbarg commented on May 5, 2024

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.

pierskarsenbarg avatar pierskarsenbarg commented on May 5, 2024

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.

anaisbetts avatar anaisbetts commented on May 5, 2024

Is TeamCity running package restore?

from refit.

pierskarsenbarg avatar pierskarsenbarg commented on May 5, 2024

No, package install.

Also, the website project isn't building locally by itself. The entire solution builds fine.

from refit.

anaisbetts avatar anaisbetts commented on May 5, 2024

Also, the website project isn't building locally by itself. The entire solution builds fine.

I don't understand this at all

from refit.

pierskarsenbarg avatar pierskarsenbarg commented on May 5, 2024

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.

anaisbetts avatar anaisbetts commented on May 5, 2024

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.

bennor avatar bennor commented on May 5, 2024

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.

leojh avatar leojh commented on May 5, 2024

I'm actually getting this error when building from the solution

from refit.

anaisbetts avatar anaisbetts commented on May 5, 2024

@leojh Can you paste in the error you're seeing here?

from refit.

leojh avatar leojh commented on May 5, 2024

@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.

bennor avatar bennor commented on May 5, 2024

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.

luisrudge avatar luisrudge commented on May 5, 2024

I'm having this problem too on appveyor with an Azure Cloud Project.

image

Notice the Undefined/projects. I'm guessing SolutionDir isn't available too? Can we fix this?

from refit.

Genri1996 avatar Genri1996 commented on May 5, 2024

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.

clairernovotny avatar clairernovotny commented on May 5, 2024

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)

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.