简体   繁体   中英

Publishing Web App Project with Visual Studio

I am using Visual Studio 2008 and trying to publish a Web Application Project, but it keeps failing when trying to add files in the project. Below is a sample of the message;

Publishing folder JavaScript... Unable to add 'JavaScript/hoverIntent.js' to the Web site. Unable to add file 'JavaScript\\hoverIntent.js'. The specified file could not be encrypted.

This happens for image files too. I am lost as to why it is happening. I should add that I am using Windows 7 build 7100, not sure if this is casuing the issue??

Any help greatly appreciated

I know this is an old topic, but I found it when I googled for the same problem.

My solution was to remove the "Encrypt" flag from Windows Explorer for the files listed (Right click -> Properties -> Advanced)

This blog post at BlackMarble is suggesting that you may have the target directory set to use encryption. Sounds like the exception you're seeing is the inability for the VS publish process to handle that.

To get around this problem:

  • use VS to publish to an intermediate directory. Somewhere on your PC perhaps.
  • copy the files yourself (with a batch file maybe) to the server

That's a workaround, at least.

Disable windows encrypted file system in cmd with the following:

fsutil behavior set disableencryption 1

Then restart your PC.

When I had this problem on publishing a Visual Studio 2010 web project either to a local folder or to a host, I was stumped. Visual Studio didn't indicate which files or even folders had caused the problem. I wasn't aware there were any encrypted files in the solution and I couldn't find any. I was unable to update my website.

I googled how to find encrypted files but none of the solutions involving efsinfo.exe were appropriate to Windows 7 then I found an example using the cipher command:

https://superuser.com/questions/58878/how-to-list-encrypted-files-in-windows-7

There were a number of different answers to finding the encrypted files. I used the command prompt method.

I opened a command prompt in the root of my application and did:

D:\\Data\\Code2011>cipher /s:MyWeb >Encryption.txt

I then did a case sensitive search in Encryption.txt for lines beginning E[space] or 'the file is encrypted'

I found two .htc files which were encrypted in a styles subfolder and was able to unencrypt them in the advanced tab of explorer file properties.

The Web then compiled and published OK.

I had this issue as well. I set the source files properties to not be encrypted but that still wasn't working. Turned out that the files were cached in the temporary deployment folder and I had to uncheck encryption there as well. It probably would have worked to delete the temporary deployment directory but the other way worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM