Visual Studio 2013 VS tools Cordova CTP3 - Build sets files in bld and bin dirs Read-Only?

1k Views Asked by At

We've just updated Visual Studio on two development machines from Update 3 to Update 4, updated Web Essentials and uninstalled Hybrid Apps CTP2 and installed the new CTP3 Visual Studio Tools for Apache Cordova.

We have a problem when we build for any project. It sets files in the bld directory to read-only. It will also set files in the bin directory to read-only.

This produces errors on subsequent attempts to build the projects. The error looks like:

1>C:\Users\rlindabury\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets(221,5): warning MSB3061: Unable to delete file "E:\code\SwiftReach\V4\Swift911\Mobile\Swift911Public\\bld\Ripple\Android\Debug\scripts\images\icons-svg\video-white.svg". Access to the path 'E:\code\SwiftReach\V4\Swift911\Mobile\Swift911Public\bld\Ripple\Android\Debug\scripts\images\icons-svg\video-white.svg' is denied.

The only way we've been able to get past this is by either deleting the project\bld and project\bin directories and building or by change the read only flags recursively on those directories before each build.

These are CTP2 projects. We created a new CTP3 project and populated it with our code and it exhibits the same error.

Is anyone else experiencing this? Is there a fix?

Thank you.

2

There are 2 best solutions below

0
On

We haven't been able to repro this but the following steps may be useful to migrate a CTP 2 project to CTP 3. The FAQ has steps to migrate a project "I’m trying to upgrade a project from CTP2 to CTP3 and its throwing errors."

Here for reference:

Then open the jsproj file in the editor (Right-click and select Edit myproject.jsproj) and modify the path in following lines:

<Import Project="$(AppData)\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets" /> 
<Import Project="$(AppData)\npm\node_modules\vs-mda-targets\Microsoft.TypeScript.MDA.targets" />

To look like these:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CordovaTools\vs-mda-targets\Microsoft.MDA.targets" /> 
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CordovaTools\vs-mda-targets\Microsoft.TypeScript.MDA.targets" />
0
On

For those of you looking for an answer to this problem, we've found the solution in the Visual Studio Cordova FAQ which you can find at:

http://www.visualstudio.com/explore/cordova-faq-vs

Even though the error isn't exactly the same, the solution is. Here's the pertinent section:

If this fails with an error message similar to:

The imported project "C:\Users\testuser\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Then open the jsproj file in the editor (Right-click and select Edit myproject.jsproj) and modify the path in following lines:

<Import Project="$(AppData)\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets" /> 
<Import Project="$(AppData)\npm\node_modules\vs-mda-targets\Microsoft.TypeScript.MDA.targets" />

To look like these:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CordovaTools\vs-mda-targets\Microsoft.MDA.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CordovaTools\vs-mda-targets\Microsoft.TypeScript.MDA.targets" />