Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

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 · Fixed by #348
Labels
Milestone

Comments

@janpio
Copy link
Member

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 has been minimized.

@janpio

This comment has been minimized.

@vincent-at-684857612710

This comment has been minimized.

@janpio

This comment has been minimized.

@shazron
Copy link
Member

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 as completed Aug 15, 2018
@janpio
Copy link
Member Author

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 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants