Not able to build .NET Core Console Application in Linux











up vote
0
down vote

favorite












I have this spec file which is trying to run a script which will run the dotnet cli program:



require 'spec_helper'

RSpec.describe 'Integration test', type: :aruba do
let(:command) { run "dotnet-test" }

it "test" do
command.write("testn")
stop_all_commands
expect(command.output).to end_with("successn")
end
end


dotnet-test script:



dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1


But I get the error :



Failure/Error: expect(command.output).to end_with("successn")
expected "MSBUILD : error MSB1009: Project file does not exist.nSwitch: ../SomeProject/src/SomeProject.Console/SomeProject.Console.csprojnnThe build failed. Please fix the build errors and run again.n" to end with "successn"


But if I run the script from that directory then program runs fine. Cannot figure out what could be the difference between the two. Help is really appreciated.










share|improve this question


















  • 1




    when you say "run the script from that directory" what exactly are you running and is that script ruby?
    – lacostenycoder
    Nov 10 at 12:39










  • @lacostenycoder by that I mean when I just run the dotnet-test script from the terminal from the directory it runs fine but when the same script is executed from Aruba then it throws that error. Hope that explains it.
    – lbrahim
    Nov 10 at 13:03










  • can you post the code you have in dotnet-test ?
    – lacostenycoder
    Nov 10 at 14:10










  • dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1
    – lbrahim
    Nov 10 at 14:17















up vote
0
down vote

favorite












I have this spec file which is trying to run a script which will run the dotnet cli program:



require 'spec_helper'

RSpec.describe 'Integration test', type: :aruba do
let(:command) { run "dotnet-test" }

it "test" do
command.write("testn")
stop_all_commands
expect(command.output).to end_with("successn")
end
end


dotnet-test script:



dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1


But I get the error :



Failure/Error: expect(command.output).to end_with("successn")
expected "MSBUILD : error MSB1009: Project file does not exist.nSwitch: ../SomeProject/src/SomeProject.Console/SomeProject.Console.csprojnnThe build failed. Please fix the build errors and run again.n" to end with "successn"


But if I run the script from that directory then program runs fine. Cannot figure out what could be the difference between the two. Help is really appreciated.










share|improve this question


















  • 1




    when you say "run the script from that directory" what exactly are you running and is that script ruby?
    – lacostenycoder
    Nov 10 at 12:39










  • @lacostenycoder by that I mean when I just run the dotnet-test script from the terminal from the directory it runs fine but when the same script is executed from Aruba then it throws that error. Hope that explains it.
    – lbrahim
    Nov 10 at 13:03










  • can you post the code you have in dotnet-test ?
    – lacostenycoder
    Nov 10 at 14:10










  • dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1
    – lbrahim
    Nov 10 at 14:17













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have this spec file which is trying to run a script which will run the dotnet cli program:



require 'spec_helper'

RSpec.describe 'Integration test', type: :aruba do
let(:command) { run "dotnet-test" }

it "test" do
command.write("testn")
stop_all_commands
expect(command.output).to end_with("successn")
end
end


dotnet-test script:



dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1


But I get the error :



Failure/Error: expect(command.output).to end_with("successn")
expected "MSBUILD : error MSB1009: Project file does not exist.nSwitch: ../SomeProject/src/SomeProject.Console/SomeProject.Console.csprojnnThe build failed. Please fix the build errors and run again.n" to end with "successn"


But if I run the script from that directory then program runs fine. Cannot figure out what could be the difference between the two. Help is really appreciated.










share|improve this question













I have this spec file which is trying to run a script which will run the dotnet cli program:



require 'spec_helper'

RSpec.describe 'Integration test', type: :aruba do
let(:command) { run "dotnet-test" }

it "test" do
command.write("testn")
stop_all_commands
expect(command.output).to end_with("successn")
end
end


dotnet-test script:



dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1


But I get the error :



Failure/Error: expect(command.output).to end_with("successn")
expected "MSBUILD : error MSB1009: Project file does not exist.nSwitch: ../SomeProject/src/SomeProject.Console/SomeProject.Console.csprojnnThe build failed. Please fix the build errors and run again.n" to end with "successn"


But if I run the script from that directory then program runs fine. Cannot figure out what could be the difference between the two. Help is really appreciated.







ruby ubuntu rspec .net-core aruba






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 12:28









lbrahim

2,23373467




2,23373467








  • 1




    when you say "run the script from that directory" what exactly are you running and is that script ruby?
    – lacostenycoder
    Nov 10 at 12:39










  • @lacostenycoder by that I mean when I just run the dotnet-test script from the terminal from the directory it runs fine but when the same script is executed from Aruba then it throws that error. Hope that explains it.
    – lbrahim
    Nov 10 at 13:03










  • can you post the code you have in dotnet-test ?
    – lacostenycoder
    Nov 10 at 14:10










  • dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1
    – lbrahim
    Nov 10 at 14:17














  • 1




    when you say "run the script from that directory" what exactly are you running and is that script ruby?
    – lacostenycoder
    Nov 10 at 12:39










  • @lacostenycoder by that I mean when I just run the dotnet-test script from the terminal from the directory it runs fine but when the same script is executed from Aruba then it throws that error. Hope that explains it.
    – lbrahim
    Nov 10 at 13:03










  • can you post the code you have in dotnet-test ?
    – lacostenycoder
    Nov 10 at 14:10










  • dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1
    – lbrahim
    Nov 10 at 14:17








1




1




when you say "run the script from that directory" what exactly are you running and is that script ruby?
– lacostenycoder
Nov 10 at 12:39




when you say "run the script from that directory" what exactly are you running and is that script ruby?
– lacostenycoder
Nov 10 at 12:39












@lacostenycoder by that I mean when I just run the dotnet-test script from the terminal from the directory it runs fine but when the same script is executed from Aruba then it throws that error. Hope that explains it.
– lbrahim
Nov 10 at 13:03




@lacostenycoder by that I mean when I just run the dotnet-test script from the terminal from the directory it runs fine but when the same script is executed from Aruba then it throws that error. Hope that explains it.
– lbrahim
Nov 10 at 13:03












can you post the code you have in dotnet-test ?
– lacostenycoder
Nov 10 at 14:10




can you post the code you have in dotnet-test ?
– lacostenycoder
Nov 10 at 14:10












dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1
– lbrahim
Nov 10 at 14:17




dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1
– lbrahim
Nov 10 at 14:17












1 Answer
1






active

oldest

votes

















up vote
1
down vote













It sounds like the script you're trying to run relies on a relative path to execute correctly. In that case you may need to cd within your spec.



See https://relishapp.com/cucumber/aruba/docs/filesystem/change-current-working-directory



Try to use the absolute path of the file instead of



../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Can you put the full path, something like:



/Users/yourusername/pathtosomeproject/SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Obviously you'll need to replace pathtosomeproject to where it is actually located.






share|improve this answer























  • I tried changing it to : codeshare.io/a3Nd4m but now I get the error that let is not allowed within describe
    – lbrahim
    Nov 10 at 13:26










  • let's see your updated spec
    – lacostenycoder
    Nov 10 at 13:28










  • I am no linux user but maybe I can change how the path to the project file is referenced?
    – lbrahim
    Nov 10 at 13:56











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238950%2fnot-able-to-build-net-core-console-application-in-linux%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













It sounds like the script you're trying to run relies on a relative path to execute correctly. In that case you may need to cd within your spec.



See https://relishapp.com/cucumber/aruba/docs/filesystem/change-current-working-directory



Try to use the absolute path of the file instead of



../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Can you put the full path, something like:



/Users/yourusername/pathtosomeproject/SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Obviously you'll need to replace pathtosomeproject to where it is actually located.






share|improve this answer























  • I tried changing it to : codeshare.io/a3Nd4m but now I get the error that let is not allowed within describe
    – lbrahim
    Nov 10 at 13:26










  • let's see your updated spec
    – lacostenycoder
    Nov 10 at 13:28










  • I am no linux user but maybe I can change how the path to the project file is referenced?
    – lbrahim
    Nov 10 at 13:56















up vote
1
down vote













It sounds like the script you're trying to run relies on a relative path to execute correctly. In that case you may need to cd within your spec.



See https://relishapp.com/cucumber/aruba/docs/filesystem/change-current-working-directory



Try to use the absolute path of the file instead of



../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Can you put the full path, something like:



/Users/yourusername/pathtosomeproject/SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Obviously you'll need to replace pathtosomeproject to where it is actually located.






share|improve this answer























  • I tried changing it to : codeshare.io/a3Nd4m but now I get the error that let is not allowed within describe
    – lbrahim
    Nov 10 at 13:26










  • let's see your updated spec
    – lacostenycoder
    Nov 10 at 13:28










  • I am no linux user but maybe I can change how the path to the project file is referenced?
    – lbrahim
    Nov 10 at 13:56













up vote
1
down vote










up vote
1
down vote









It sounds like the script you're trying to run relies on a relative path to execute correctly. In that case you may need to cd within your spec.



See https://relishapp.com/cucumber/aruba/docs/filesystem/change-current-working-directory



Try to use the absolute path of the file instead of



../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Can you put the full path, something like:



/Users/yourusername/pathtosomeproject/SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Obviously you'll need to replace pathtosomeproject to where it is actually located.






share|improve this answer














It sounds like the script you're trying to run relies on a relative path to execute correctly. In that case you may need to cd within your spec.



See https://relishapp.com/cucumber/aruba/docs/filesystem/change-current-working-directory



Try to use the absolute path of the file instead of



../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Can you put the full path, something like:



/Users/yourusername/pathtosomeproject/SomeProject/src/SomeProject.Console/SomeProject.Console.csproj


Obviously you'll need to replace pathtosomeproject to where it is actually located.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 10 at 19:26

























answered Nov 10 at 12:44









lacostenycoder

3,42411226




3,42411226












  • I tried changing it to : codeshare.io/a3Nd4m but now I get the error that let is not allowed within describe
    – lbrahim
    Nov 10 at 13:26










  • let's see your updated spec
    – lacostenycoder
    Nov 10 at 13:28










  • I am no linux user but maybe I can change how the path to the project file is referenced?
    – lbrahim
    Nov 10 at 13:56


















  • I tried changing it to : codeshare.io/a3Nd4m but now I get the error that let is not allowed within describe
    – lbrahim
    Nov 10 at 13:26










  • let's see your updated spec
    – lacostenycoder
    Nov 10 at 13:28










  • I am no linux user but maybe I can change how the path to the project file is referenced?
    – lbrahim
    Nov 10 at 13:56
















I tried changing it to : codeshare.io/a3Nd4m but now I get the error that let is not allowed within describe
– lbrahim
Nov 10 at 13:26




I tried changing it to : codeshare.io/a3Nd4m but now I get the error that let is not allowed within describe
– lbrahim
Nov 10 at 13:26












let's see your updated spec
– lacostenycoder
Nov 10 at 13:28




let's see your updated spec
– lacostenycoder
Nov 10 at 13:28












I am no linux user but maybe I can change how the path to the project file is referenced?
– lbrahim
Nov 10 at 13:56




I am no linux user but maybe I can change how the path to the project file is referenced?
– lbrahim
Nov 10 at 13:56


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238950%2fnot-able-to-build-net-core-console-application-in-linux%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues