Relative path issues for projects in a solution

Lilith River's Avatar

Lilith River

26 Aug, 2014 05:34 PM

Given a solution file in a subfolder, paths within that solution file will be relative to the file's location. This doesn't seem to work with MSBuild, as it is expecting paths relative to the working directory.

We get: MSBUILD : error MSB1009: Project file does not exist.

We can move the solution to the working directory and change the paths, of course, but can this be documented or fixed?

Also, providing a nuget.config file that overrides the packages directory might also be considered a best practice worth documenting, as otherwise AV builds will fail unexpectedly with reference errors (a) in the presence of multiple solution files, (b) if submodules are used with nuget.config files, or (c) if there is any user-specific nuget configuration on the dev machine.

  1. Support Staff 1 Posted by Feodor Fitsner on 27 Aug, 2014 10:17 PM

    Feodor Fitsner's Avatar

    The problem was not in relative path to the project in solution, but it current directory before calling msbuild, but I see you already fixed the issue.

  2. 2 Posted by Lilith River on 27 Aug, 2014 10:42 PM

    Lilith River's Avatar

    Since I was using the declarative form, this was unexpected.

    build:
      project: Imazen.WebP\Imazen.WebP.sln
    

    https://github.com/imazen/libwebp-net/blob/master/appveyor.yml#L50

    Is this normal MSBuild behavior, or only when there is a SolutionDir override in a system targets file??

  3. Support Staff 3 Posted by Feodor Fitsner on 27 Aug, 2014 10:45 PM

    Feodor Fitsner's Avatar

    Well, the problem was msbuild not being able to find Imazen.WebP\Imazen.WebP.sln while called not from root build folder (clone folder).

  4. 4 Posted by Lilith River on 28 Aug, 2014 01:45 AM

    Lilith River's Avatar

    Ah, you're saying the error message "Project not found" referred to the solution file, not the project files? And if so, I'm assuming that the working directory is not reset following the before_build stage.

  5. Support Staff 5 Posted by Feodor Fitsner on 28 Aug, 2014 01:48 AM

    Feodor Fitsner's Avatar

    Yeah, that's correct.

    -Feodor

  6. 6 Posted by Dale on 03 Dec, 2014 06:19 AM

    Dale's Avatar

    Hi guys

    Not sure if this is the same issue, I am building a walkthrough to demo the Appveyor tech to a team I'm working with, and I am having a few different issues with converting my web portal config settings to a more powerful YAML, multi-branch, multi site, deployment strategy. ATM, i am running into what seems like a basic error:

    Build started
    2git clone -q --branch=feature/Feature-1-YAMLConfig https://bitbucket.org/bsetechcayman/demo-project.git c:\projects\myproject
    3git checkout -qf 87f574784e1c
    4Starting Internet Information Services (IIS)
    5Specified build project file or folder does not exist: "NiftyDemo.sln"

    But the sln file, is definitely there, i've been building and releasing the project previously, so i'm obviously doing something silly an describing the path value incorrectly? Any ideas?

    My yaml literally has:

    build:
      project: NiftyDemo.sln # path to Visual Studio solution or project

    thanks

  7. Support Staff 7 Posted by Feodor Fitsner on 03 Dec, 2014 06:23 AM

    Feodor Fitsner's Avatar

    Change it to:

    build: 
      project: NiftyDemo\NiftyDemo.sln
    
  8. 8 Posted by Dale on 03 Dec, 2014 06:36 PM

    Dale's Avatar

    Thanks - worked great. I was basing the pathing off the yaml demo:

    build:
      project: MyTestAzureCS.sln # path to Visual Studio solution or project

    So given that I have to specify the ProjectName\ProjectName.sln, does this mean I have not configured pathing correctly elsewhere?

    Thanks

  9. Support Staff 9 Posted by Feodor Fitsner on 03 Dec, 2014 06:37 PM

    Feodor Fitsner's Avatar

    For example?

  10. 10 Posted by Dale Holborow on 03 Dec, 2014 06:41 PM

    Dale Holborow's Avatar

    Hi Feodor

     

    Sorry, I don’t understand your question. I have been working through the www.appveyor.com/docs/appveyor-yml <http://www.appveyor.com/docs/appveyor-yml> and trying to configure multiple deployment targets etc, (eg staging, production websites on Azure), and part of the configuration I was using was the declaration of the solution file, as per the link above. In that example, there is no directory prefixing the solution file, so if for my appveyor deployment I DO have to specify the folder, I was wondering if I had messed up some other part of my yaml config file, that’s all :)

     

    Thanks

    Dale

  11. Support Staff 11 Posted by Feodor Fitsner on 03 Dec, 2014 06:43 PM

    Feodor Fitsner's Avatar

    Ah, I see :)

    It's supposed all folders in YML should be relative to the root of your repo.

  12. 12 Posted by Dale Holborow on 03 Dec, 2014 06:46 PM

    Dale Holborow's Avatar

    Ah… I suddenly see what you mean *embarrassed face*.

     

    Thanks mate!

  13. 13 Posted by Heena on 15 Oct, 2016 10:09 AM

    Heena's Avatar

    My question is little bit differ. I had configure MSBuild plugin into jenkins, and also depyoed my visual studio solution file on GitHub repository. now the problem is when I am trying to configure this project with MSBuild, I am getting errors as .proj file not found.

    I simply want to know that, how could I set path of MSBuild file and what would be the execute windows batch command?

  14. 14 Posted by Ilya Finkelshte... on 17 Oct, 2016 05:47 PM

    Ilya Finkelshteyn's Avatar

    Sorry, are you using Jenkins or Appveyor?

    --ilya.

  15. 15 Posted by Heena Patel on 18 Oct, 2016 04:47 AM

    Heena Patel's Avatar

    Using Jenkins

  16. 16 Posted by Heena Patel on 18 Oct, 2016 05:08 AM

    Heena Patel's Avatar

    Hello IIya,

    Greetings of the day!!!

    Kindly find the attached images of my MSBuild configuration in jenkins and
    error which I am facing.

    [image: Inline image 1]

    [image: Inline image 2]

    I had also tried to put full workplace path at MSBuild build file but still
    got same error.

    Please suggest me, what to do as I am new with jenkins

  17. 17 Posted by Ilya Finkelshte... on 18 Oct, 2016 04:14 PM

    Ilya Finkelshteyn's Avatar

    Hello Heena,

    I am sorry, but this is Appveyor support forum.

    --ilya.

  18. Ilya Finkelshteyn closed this discussion on 18 Oct, 2016 04:14 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac