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

Generator throws System.IO.FileNotFoundException if RefitStubs.cs does not exist #137

Closed
alexeyzimarev opened this issue Mar 16, 2015 · 4 comments
Labels

Comments

@alexeyzimarev
Copy link

In version 2.2.1 the generator crashes with FileNotFoundException if target RefitStubs.cs (second parameter) does not exist.

Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'C:\Te
amCity\buildAgent\work\88ce84b2745369bc\TestProject\RefitStubs.cs'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean
bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detec
tEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean
checkHost)
at System.IO.File.ReadAllText(String path, Encoding encoding)
at Refit.Generator.Program.Main(String[] args)

When I create an empty RefitStubs.cs file, the build works. It worked fine in 2.1, started to fail after updating to 2.2.

@anaisbetts
Copy link
Member

RefitStubs.cs is added as part of the NuGet package, did you remove it by-hand?

@alexeyzimarev
Copy link
Author

There are two possibilities.

  1. Packages are not restored on a build server but loaded from VCS.
  2. NCrunch build, no nuget restore but different output folder

@Cheesebaron
Copy link
Contributor

Why was this closed?

@alexeyzimarev
Copy link
Author

@Cheesebaron Paul is right, when nuget restore is done, the file is created. It is a bit inconvenient since it does not work when packages are restored for a project, not for the whole solution, and this is a default for Visual Studio.

@lock lock bot added the outdated label Jun 25, 2019
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants