Advertisement

05.08.2008 at 03:28PM PDT, ID: 23387909 | Points: 250
[x]
Attachment Details
ASP.NET Compilation error - problem with aspnet temp directory
Tags: Microsoft, ASP.NET, v1.1.4322, running on Windows XP SP2, Compilation Error Message: CS0016: Could not write to output file 'c:\windows\temp\<appname>\xxxxxxxx\xxxxxxxx\xxxxxx.dll' -- 'The directory name is invallid
I'm working with a WIndows XP SP2 image that was provided to me by a customer and I am trying to debug a problem with an asp.net 1.1 application that we are installing on the image.    I have been reading a lot of posts related to this subject all over the web, and I have narrowed the problem down to the fact that ASP.NET is trying to use the Administrator's temp directory instead of the %systemroot%\temp directory for the intermediate compilation files before it copies them to its assigned temp directory.  

Normally this error message would be caused by an invalid TEMP directory (as specified by the system TEMP variable) or missing permissions on the TEMP folder for ASP.NET or NetworkService.  As i understand how ASP.NET compilation is supposed to work it uses the TEMP env var to build the binaries as it compiles and then copies the final file to its configured temp directory to run from.
I checked that my system TEMP variable is set to %SYSTEMROOT%\temp and so is TMP.   And I checked the permissions on this folder and added full control for NetworkService and ASP.NET, but it had no effect.  Changing the Admin's TEMP variable to another value wouldn't stick and kept getting reset on each reboot.  That doesn't seem like a valid solution anyway.

I tried changing the ASP.NET temp directory by modifying machine.config to set tempDirectory="c:\windows\temp" on the compilation tag, but that just changes the compilation target from c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files to c:\windows\temp.  It still uses another TEMP directory to build the dll before it copies to the tempDirectory it runs it from.  Somehow its getting the Administrator's personal TEMP variable instead of the system variable.  I am running as Administrator for testing purposes

I found the only way I could make this go away was to add full control permissions for ASP.NET on c:\documents and settings\administrator\Local Settings\Temp.    I just don't think this will be an accepted solution for my customer since they are very security-minded and will not want to create privileges in inappropriate places.  How can I make ASP.NET use the system temp folder again instead of the user's temp folder?  
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: gadillon
Question Asked On: 05.08.2008
Participating Experts: 2
Points: 250
Views: 0
Translate:
Loading Advertisement...
05.12.2008 at 04:14AM PDT, ID: 21545879

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 10:53AM PDT, ID: 21549084

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 05:04PM PDT, ID: 21551404

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 07:56PM PDT, ID: 21551954

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2008 at 07:31AM PDT, ID: 21555401

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2008 at 10:55AM PDT, ID: 21557515

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.14.2008 at 12:52PM PDT, ID: 21568049

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.12.2008 at 04:14AM PDT, ID: 21545879

Rank: Genius

Hi gadillon just offering ideas only since your question has received no responses at all.
I lack experience in this so it is just a gesture of help.
I dont know if you can actually move this folder since it is assigned to the administrator by default. and the directory c:\documents and settings\administrator\Local Settings\Temp.
Is far safer than C: windows
asp.net 1.1 has an updated version too.
Sometimes the new versions offer more?
http://www.asp.net/downloads/essential/

See if this can assist you maybe a work around.
 http://support.softartisans.com/docs/FileUp/security.htm
ASP.NET Temp Directory Permissions
http://support.microsoft.com/kb/317012
How to Assign Write Permissions to the Temporary ASP.NET Folder
http://msdn.microsoft.com/en-us/library/aa545633.aspx
ASP FAQ
http://www.aspnetfaq.com/default.aspx?FaqId=258&CategoryId=39
The true hidden ASP temp directory
http://www.velocityreviews.com/forums/t119667-finding-aspnet-temporary-directory.html

ASP.NET Development Server
http://www.asp.net/LEARN/moving-to-asp.net-2.0/module-01.aspx

hope it helps a little
 
05.12.2008 at 10:53AM PDT, ID: 21549084
Thanks Merete.   Upgrading to 2.0 or higher isn't an option for this app since its legacy under support contract.   I've seen a lot of weirdness in the past with the way Windows handles the environment variables and what environment you end up with when you impersonate or change contexts.   I'm afraid I'm stuck with something like that, but no idea how to break it loose.
 
05.12.2008 at 05:04PM PDT, ID: 21551404

Rank: Genius

Dont worry about accepting my comments here gadillon if they doen tassist you.
looking in your account you have only asked this in one zone try reposting this to 2 new zones, reduce the points.
or delete this and repost to three zones.
Cross posting it's called.
Often times it's a good idea to post to a zone on topic such as
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/
but may not have a lot of experts there,
so you post again  to a zone with more experts like this one
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/
So over these zones you have pretty good coverage.

If you need more help send a ping to  Community advisor zone they'll send out requests for assistance.
You can also use the report abuse tab in your question to send in requests for assistance.
EE has incorperated a lot of new steps to help yourself.
http://www.experts-exchange.com/help.jsp#hs7
http://www.experts-exchange.com/help.jsp

cheers

 
05.12.2008 at 07:56PM PDT, ID: 21551954
gadillon, I have couple of questions .. Please bear with me while I understand the issue here..
You said
"Somehow its getting the Administrator's personal TEMP variable instead of the system variable"
What system variable you are talking about?

Isnt Administrator's personal TEMP variable is the environment variable for TEMP, that asp.net uses during compilation? Or Am I missing something here

Also, I am wondering, why would this compilation issues matter to your customer. Arent you only deploying the site after compilation?
 
05.13.2008 at 07:31AM PDT, ID: 21555401
KumarReddi,

I'm talking about the system TEMP variable, which is usually set to %SYSTEMROOT%\temp.  Looking at a typical windows XP machine, ASP.NET doesn't normally have any access at all to the Administrator's temp directory, so I dont; see whay I should have to grant access.  We have other Windows XP images where this ASP.NET application works fine with no permissions changes for ASP.NET, so I'm trying to understand what makes this system different.

I'm afraid it does matter to the customer, since the application gets compiled when you access the page, so they will get a CS0016 error "Directory invalid" if this isn't setup right.  I could just grant the permissions and continue, I've been able to make it work that way, but I think its wrong.
 
05.13.2008 at 10:55AM PDT, ID: 21557515
Gadillon,

Here is my understanding of how the asp.net 1.1  execution happens on the server.  Let me know if I am missing something
--------------------------------------------------------------------------------------------------------------------
If you deploy a compiled .net web application, no more compilation on the server happens, only the shadow copying onto the Temporary ASP.NET files.  Thats why we do not provide any of the class files to the customer

If you are talking about JIT compilation, that is just to turn IL code into machine code, but it has nothing to do with asp.net, its how the CLR works.

On the other hand, if you are talking about the inline code in your aspx page, it does get compiled the first time it is accessed, but it is only placed under the same shadow copy folder in the Temporary ASP.NET files.
-------------------------------------------------------------------------------------------------------------------------
So, I really do not see why these development compilation issues matter to the client still.. The compliation, if at all happens during the execution is different from the compilation we do on VS.NET

And about the System TEMP variable, I am not sure what exactly it is.. I only know about the TEMP Environment variable, which you can find out from  SET command

Excuse my ignorance, if I am missing something big here..
 
05.14.2008 at 12:52PM PDT, ID: 21568049
KumarReddi,

yes the system TEMP variable is an environment variable.  Its distinct from the Administrator's TEMP variable which supercedes the system TEMP variable when you are running as Administrator.

If there is no compilation required then why do I get a compilation error  CS0016?  I must have made a mistake in setting up this question, because the error message is actually listed in the Tags.  This error only happens on a deployed system, not on the developer's system.  VS.NET is not even installed.

Let me restate the error message:
Compilation Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework\Temporary ASP.NET Files\<appname>\xxxxxxxx\xxxxxxxx\xxxxxx.dll' -- 'The directory name is invallid'
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628