Subject: VS2005 website deployment problems with EFS

  • Thread starter Thread starter JeffDotNet
  • Start date Start date
J

JeffDotNet

Sorry for the re-post. Microsoft has ask me to re-post so that my question
can be properly routed. This was originally submitted 4/14/2008.

Recently we were required to install EFS on our machines.

Ever since the installation of EFS I have been unable to successfully us the
publish website or copy website deployment methods without manually
decrypting the files first.

Dev laptop: Win XP SP2 (Machine I am deploying website from)
Visual Studio 2005 SP1
Dev Server: win2003 (Destination of the website)

“Publish websiteâ€
Publish website will exit with Publish Succeeded but will not publish any
files that have been encrypted by EFS. (This leaves me little more than a
set of empty directories)

“Copy Websiteâ€
Using Visual studio “copy website†takes forever and in the end fails and
the log reports it was unable to encrypt files.

If I manually decrypt the files before using “Copy Website†visual studio is
able to properly send the files to the server. However this manual
decryption causes the source file timestamps to be modified and this is very
undesirable.

Manual Copy (Without “Copy Websiteâ€)

If I manually copy the files to my development server it takes an extremely
long time. (between 15-45minutes for a small intranet application) I assume
this is due to the decryption being done just prior to moving the files.

If I manual decrypt the files then the manual copy the files it is quick as
ever.


The helpdesk has recommended moving my projects outside of my documents to
avoid the EFS encryption. Is there a way to configure VS2005 to work around
EFS? I would really prefer not to move my VS projects outside of my
documents.

Goals:
• Use all the VS2005 and EFS as expected by the Microsoft (Things tend to
work best when you are using them they way the maker expects)
• Keep all of my documents that I would like backed up under My Documents.
(Anytime my laptop is backed by IT all of my documents will archived. My
source code is under source control but I would like it backed up here as
well)
• Try to leave my documents encrypted if the intent of using EFS is to have
my documents encrypted. (Even if the help desks recommendation for use
VS2005 is to move the files outside of the EFS territory)

If anyone is aware of a way to configure VS2005 to allow Publish Website and
Copy Website to work properly with EFS and still achieve the goals listed
above please let me know.

Thanks,
Jeff
 
Hi Jeff,
Dev laptop: Win XP SP2 (Machine I am deploying website from)
Visual Studio 2005 SP1
Dev Server: win2003 (Destination of the website)
“Publish websiteâ€
Publish website will exit with Publish Succeeded but will not publish any
files that have been encrypted by EFS. (This leaves me little more than a
set of empty directories)

I did a simple test but could not reproduce the same behavior. Could you
provide the step-by-step instructions as to how to reproduce it? I'll try
it again on my side to see if I could repro it.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Allen,

The following steps should recreate the Publishing problem problem:
1. Make a website project in vs2005 (without moving the source files from
default location under my documents)
2. Add Non-GAC assembly references to the website project
3. Install Microsoft EFS (I suspect EFS could be installed first and still
re-create the problem)
4. Observe that all of the source files are now encrypted (file names
should appear green)
5. Attempt to publish the website to a remote machine (This will take much
longer than a deployment without EFS)
6. Verify that the assembly references did not successfully deploy
(Encrypted assemblies do not successfully deploy)
7. Manually decrypt all directories under the websites source directory
8. Immediately publish the website to a different location before EFS
re-encrypts the files
9. Verify that the second attempt successfully deployed (And deployed far
faster than the first attempt)

When I attempted to use "copy website" under the same encrypted state some
of the files would report that they failed to encrypt and again the
deployment would be incomplete.


When a website project is not encrypted it appears to deploy normally. I
suspect that this is because Visual Studio is attempting to do something on
my behalf and does not have the privilege to access the files that have been
encrypted with my profile. If the website is stored outside of my documents
the projects deploy correctly. However my goal is continue to keep all of my
projects under my projects allowing EFS to work as expected and configure
VS2005 to work as it did before installation of EFS.


I suspect there should be a lot of people out there with this same problem
as these are both Microsoft products.

Thanks for your help,

Jeff
 
Hi Jeff,
Thanks for your update.

I tried again but still cannot reproduce the problem. Below is my test
steps.

1. On Windows XP Professional SP2, launch Visual Studio 2005 SP1.

2. Select File->New->Web Site in the menu to create a new ASP.NET Web Site
project. The location of the project is:
C:\Documents and Settings\allenc\My Documents\Visual Studio
2005\WebSites\WebSite1

3. Add a new ClassLibrary project named ClassLibrary1 in the same solution.

4. Add the assembly ClassLibrary1.dll as the reference of the WebSite1
project. When it's done we can see the dll file and pdb files appear in the
Bin folder in the solution explorer window.

5. Close Visual Studio.

6. Go to C:\Documents and Settings\allenc\My Documents\Visual Studio
2005\WebSites, find the WebSite1 folder, right click it and select
Properties.

7. In the General tab, click "Advanced" button.

8. In the "Advanced Attributes" window, check "Encrypt contents to secure
data" and click "OK" button.

9. Click "OK" button in the properties window, in the "Confirm Attribute
Changes" window, check "Apply changes to this folder, subfolders and
files". Click "OK" button. All files/folders in the WebSite1 folder then
turn green.

10. Launch Visual Studio again. Open the WebSite1 solution.

11. Right click the web site project node in the solution explorer window,
select "Publish Web Site". Click "..." button. Click "Remote Site" on the
left panel. Enter remote site location in the TextBox. Then click "Open"
button. Click "OK" button to publish the web site. The target machine is
Windows Server 2003 Enterprise SP1.

12. It says publish succeeded in Visual Studio. I then checked the wwwroot
folder on the Windows Server 2003. The dll, config and aspx files are in
the expected position. The WinXP and Win2003 are in the same domain. I used
the same domain account to login these systems.

Could you test the above steps to see if it works? Or is there any
difference between your steps and mine?


Regards,
Allen Chen
Microsoft Online Support
 
Hi Allen,

I ran the following tests under the same domain account:
1. Your test with everything in my documents (with EFS automatically
encrypting the files)
2. Your test with files located outside my documents (This allowed me to
encrypted the files as you described)
3. Your test with files located outside my documents (Encrypted website
files and then decrypting only the bin directory immediately before
publishing)
4. Attempted to “Copy website†located outside my documents (I encrypted
the files as you described)
5. Attempted to “Copy website†located outside my documents with all file
decrypted.

In cases 1 & 2:
• Visual Studio reported “Publish Succeededâ€
• The published website was incomplete; the bin directory was missing the
referenced class library

I n case 3:
• Visual Studio reported “Publish Succeededâ€
• The bin directory contained the referenced class library.
• The site was properly deployed with all files in appropriate locations

In case 4:
• Visual Studio reported “There were errors during copy web. Please view
log for details.â€
• All “from source to remote Web site†actions failed with “The specified
file could not be encryptedâ€
• Neither the source files nor the assembly in the bin directory were
deployed
• This deployment attempt took about a minute (a very long time for an
extremely small website)

In case 5:
• Copy from Source Web site to Remote Web site finished in a couple of
seconds
• The website was deployed successfully with all files in appropriate
locations

Both Publish Website and Copy Website appear to break when the website
files are encrypted.
I suspect that visual studio may be attempting to manipulate the files
in a process that does not belong to me and therefore cannot access the files
that have been encrypted for my profiles use only.

Thanks for your help,

Jeff
 
Hi Jeff,

Thanks for your update.

It looks like your test result is not the same as mine so there must me a
difference between our environments. Could you provide the following
information?

1. What's the File System of your two machines? Is it NTFS or FAT? You can
find this information via the properties window of the disk. On my side
both are NTFS.

2. On the Windows Server 2003 machine, is the folder encrypted before
publishing? In my test it's not encrypted.


My environment:

Machine A: Windows XP Professional SP2 + Visual Studio 2005 SP1
Machine B: Windows Server 2003 Enterprise Edition SP1


Regards,
Allen Chen
Microsoft Online Support
 
Hi Allen

1.Both machines are NTFS
2.The folder does not exist on the Windows Server 2003 machine before
publishing


My environment:
Machine A: Windows XP Professional SP2 + Visual Studio 2005 SP1
Machine B: Windows Server 2003 R2 Standard Edition SP2

In all of case the files and folders deployed to the Windows Server 2003 are
not encrypted.

Jeff
 
Hi Jeff,

Thanks. I'll set up a Windows Server 2003 R2 Standard Edition SP2 machine
to test again. It may take one or two days. In the mean time, could you
double check the steps I listed in my previous post and confirm the result
of my test steps is that the ClassLibrary1.dll cannot be successfully
published while other files of the project can?

Regards,
Allen Chen
Microsoft Online Support
 
Hi Allen,

Sorry for the delay. I tried to post twice but the service not available.

Yes, when using “Publish Website†all the source files except the referenced
assembly are deployed. When I decrypt the project everything deploys
correctly.

When using “Copy Website†on the same encrypted website project neither the
source files nor the referenced assembly were deployed. (“Copy Website†only
deployed empty folders.) When I decrypt all the website files “Copy Websiteâ€
successfully deploys the full website.


Best Regards,

Jeff
 
Hi Jeff,
Yes, when using “Publish Website†all the source files except the referenced
assembly are deployed. When I decrypt the project everything deploys
correctly.

Thanks for your response. Unfortunately I still cannot reproduce this issue
on my side. Due to the limitation in the newsgroup support I suggest you
contact CSS for incident based support if it's an urgent issue:

http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us

Our dedicated support engineer will work with you to investigate this issue.

Below is the summary of this case. You can provide it to our engineer
(again, please follow repro steps to make sure it's correct).

==================================================Symptom:
In Visual Studio 2005 SP1, when using Publish Website all the source files
except the referenced
assembly are deployed. When I decrypt the project everything deploys
correctly.
When using Copy Website on the same encrypted website project neither the
source files nor the referenced assembly were deployed. (Copy Website
only
deployed empty folders.) When I decrypt all the website files Copy
Website
successfully deploys the full website.

==================================================Environment:

Dev machine: Windows XP Professional SP2 + Visual Studio 2005 SP1
Server: Windows Server 2003 R2 Standard Edition SP2

==================================================Objective:
When using Publish Website and Copy Website all the files should be
deployed even if they are encrypted.

==================================================Repro Steps (cannot be
reproduced by the engineer in the newsgroup):

1. On Windows XP Professional SP2, launch Visual Studio 2005 SP1.

2. Select File->New->Web Site in the menu to create a new ASP.NET Web Site
project. The location of the project is:
C:\Documents and Settings\allenc\My Documents\Visual Studio
2005\WebSites\WebSite1

3. Add a new ClassLibrary project named ClassLibrary1 in the same solution.

4. Add the assembly ClassLibrary1.dll as the reference of the WebSite1
project. When it's done we can see the dll file and pdb files appear in the
Bin folder in the solution explorer window.

5. Close Visual Studio.

6. Go to C:\Documents and Settings\allenc\My Documents\Visual Studio
2005\WebSites, find the WebSite1 folder, right click it and select
Properties.

7. In the General tab, click "Advanced" button.

8. In the "Advanced Attributes" window, check "Encrypt contents to secure
data" and click "OK" button.

9. Click "OK" button in the properties window, in the "Confirm Attribute
Changes" window, check "Apply changes to this folder, subfolders and
files". Click "OK" button. All files/folders in the WebSite1 folder then
turn green.

10. Launch Visual Studio again. Open the WebSite1 solution.

11. Right click the web site project node in the solution explorer window,
select "Publish Web Site". Click "..." button. Click "Remote Site" on the
left panel. Enter remote site location in the TextBox. Then click "Open"
button. Click "OK" button to publish the web site. The target machine is
Windows Server 2003 Enterprise SP1.

12. It says publish succeeded in Visual Studio. I then checked the wwwroot
folder on the Windows Server 2003. The dll, config and aspx files are in
the expected position. The WinXP and Win2003 are in the same domain. I used
the same domain account to login these systems.


Regards,
Allen Chen
Microsoft Online Support
 
Back
Top