CordovaApp.Windows.jsproj(70,3): error MSB4019: The imported project

◇◆丶佛笑我妖孽 提交于 2019-12-06 09:34:36

Anybody here had same or similar problem with building Cordova windows projects without having Visual Studio with tools installed?

As far as I know the missing target files are installed together with the Visual Studio instead of the MSBuild Tools.

I created a blank win10 environment(test machine) and installed both MSBuild tools also the Windows 10 SDK, I encountered the issue you have, the Microsoft.VisualStudio.WJProject.Default.props cannot be found.

Then I checked my original machine(have Visual Studio 2015 installed), the folder that contains the correct target files(C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\JavaScript) is created at the same date as Visual Studio installed.

So Visual Studio installed something that we did not install. I have tried to copy the MSBuild folder from my original machine to the test machine, the error MSB4019 has been resolved, but I got another error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\JavaScript\Microsof t.VisualStudio.JavaScript.UAP.targets(82,3): error : "10.0.14393.0" is not a supported value for TargetPlatformVersion. Please change it on the Project Prop erty page.

After search the Internet, the TargetPlatformVersion is related to the Windows SDK version, then I have changed the value to the windows SDK version in the project file, but this error is still persist.

Obviously, The easiest way to build your building Cordova windows projects is to install Visual Studio. If you want make it work without Visual Studio, it sometimes a lot of work to figure out. You'll need to install the right Windows / .NET Platform SDK. You can install multiple of these SDKs side by side. You might need to install further SDKs to get your application to compile. The downloads for these all assume that you also have Visual Studio installed, but many of their payloads can also be installed separately. It can become quite a hassle.

Hope this can help you.

" Microsoft.VisualStudio.WJProject.Default.props cannot be found. error MSB4019

enter in the platform/windows/cordova/lib open the msbuildtools with the notepad and edit this part: it's simple, you will edit the "var versions = ['15.0', '14.0', '12.0', '4.0'];" with your versions your have.

for example will remove the 15 and 14 in the two functions var versions = ['12.0', '4.0'];

and remove the "|| versions[2] || versions[3]" in this line var msbuildTools = versions[0] || versions[1] || versions[2] || versions[3];

"

module.exports.findAvailableVersion = function () {
var versions = ['15.0', '14.0', '12.0', '4.0'];

    return Q.all(versions.map(checkMSBuildVersion)).then(function (versions) {
        // select first msbuild version available, and resolve promise with it
        var msbuildTools = versions[0] || versions[1] || versions[2] || versions[3];

        return msbuildTools ? Q.resolve(msbuildTools) : Q.reject('MSBuild tools not found');
    });
};

function findAllAvailableVersionsFallBack() {
    var versions = ['15.0', '14.0', '12.0', '4.0'];
    events.emit('verbose', 'Searching for available MSBuild versions...');

    return Q.all(versions.map(checkMSBuildVersion)).then(function(unprocessedResults) {
        return unprocessedResults.filter(function(item) {
            return !!item;
        });
    });
}    "
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!