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

Any problem in build process triggers "No valid MSBuild was detected for the selected target:" exception #266

Closed
janpio opened this issue Feb 23, 2018 · 7 comments
Labels
bug
Milestone

Comments

@janpio
Copy link
Member

@janpio janpio commented Feb 23, 2018

After code restructuring this Exception is triggered a bit too often.

E.g. if just the build process in MSBuild fails:

CordovaError: No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1

This issue refers to a problem in the way the code is structured - returning an exception that is not 100% correct all the times.

@vincent-at-684857612710

This comment was marked as off-topic.

@janpio

This comment was marked as off-topic.

@vincent-at-684857612710

This comment was marked as off-topic.

@janpio

This comment was marked as off-topic.

@shazron
Copy link
Contributor

@shazron shazron commented Aug 15, 2018

Essentially the MSBuild detection code does not work well with VS 2017. Duping this into #274

@shazron shazron closed this Aug 15, 2018
@janpio
Copy link
Member Author

@janpio janpio commented Aug 15, 2018

The original issue was another problem - any problem in the build process triggers this error message as it is a general catch for any error.

@janpio janpio reopened this Aug 15, 2018
@janpio
Copy link
Member Author

@janpio janpio commented May 6, 2019

For future reference, this is the offending code:

return MSBuildTools.getLatestMatchingMSBuild(selectedBuildTargets) // get latest msbuild tools
.then(function (result) {
var msbuild = result[0];
var myBuildTargets = result[1];
// Apply build related configs
prepare.updateBuildConfig(buildConfig);
if (buildConfig.publisherId) {
updateManifestWithPublisher(buildConfig, myBuildTargets);
}
cleanIntermediates();
// build!
return buildTargets(buildConfig, myBuildTargets, msbuild);
}).then(function (pkg) {
events.emit('verbose', ' BUILD OUTPUT: ' + pkg.appx);
return pkg;
}).catch(function (error) {
return Q.reject(new CordovaError('No valid MSBuild was detected for the selected target: ' + error, error));
});
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants