.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Wrong path returned by Environment.GetFolderPath(Environment.SpecialFolder.ApplicationFolder) on IIS

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :.NET Framework

On my test machine running (Windows XP, IIS5.1) the following code executed within a C# .NET WebService (.SVC) under a custom process identity (using machine.config to specify the user)


correctly returns

  c:\Documents and Settings\myUserName\Application Data

However, on (Terminal Services) Windows 2003 machine running IIS6 and executing the same code but now using ApplicationPool to specify the same process identity the method returns:

c:\Documents and Settings\Default User\Application Data

Things I have checked while running on the TS/IIS6 machine:

  • myUserName belongs to the group IIS_WPG (even tried Admin)
  • a call to Environment.UserName correctly returns myUserName
  • a call to Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); also returns a 'Default User' path, likewise with DesktopDirectory
  • logged on as myUserName and ensured that C:\Documents and settings\myUserName exists
  • running the exact same code in a .net application on the Windows 2003 box, this works and returns the correct path.
  • <

    View Complete Post

More Related Resource Links

.NET Delegates: Making Asynchronous Method Calls in the .NET Environment


One of the many great features of the .NET Framework is that it has asynchronous infrastructure built in. In .NET you can call any method asynchronously by defining a delegate for the method and calling the delegate's asynchronous methods. This is beneficial to your application because when a synchronous call is made, the calling thread is blocked until the method completes whereas an asynchronous call is made on a different thread, and this allows the original thread to continue its work while the asynchronous call is in progress.This article explains delegates in .NET and how to use them to perform asynchronous calls, eliminating age-old threading problems.

Richard Grimes

MSDN Magazine August 2001

Windows CE: eMbedded Visual Tools 3.0 Provide a Flexible and Robust Development Environment


This article provides an overview of writing applications for Windows CE 3.0. Unicode support in Windows CE, the kernel, memory management, the object store, and COM and DCOM are discussed. The article also covers the user interface, graphics, the Internet, and how Windows CE compares to the desktop in each of these areas. eMbedded Visual Tools 3.0 is discussed in depth. To help the reader decide which tools to use, development with Visual Basic, Win32, MFC, and ATL are explained. Text editor samples with this article have been developed with Visual Basic and Win32 so their implementations can be compared.

Paul Yao

MSDN Magazine January 2001

Problems moving an InfoPath form from a DEV system to QA environment


We developed an InfoPath form using a local DEV environment.  The site collection under which the form was developed was http://server1/.

We are now attempting to deploy this form to a TEST environment that uses a slightly different structure for the collection, namely http://server2/sites/sitecol1.

In both cases the site that contains the form is /fin (so we were using http://server1/fin in DEV and want to use http://server2/sites/sitecol1/fin in TEST). 

The form contains VBA code and so requires admin-based deployment via Central Administration, so to deploy to TEST we:

1. Publish the form against the TEST server using InfoPath Designer

2. Upload the form using Central Administration > Application Managment > Manage Form Templates

3. After upload, we activate the form for the site collection http://server2/sites/sitecol1/

4. The form is then associated with a Form Library

When we try to create an instance of the form within this library we get the following error when we click on New to create the form instance:

The following location is not accessible, because it is in a differ

Cannot export from a Report in SharePoint integrated mode in a server hardend environment


We have installed Reporting Services 2008 integrated with MOSS with SQL Server 2008 on a 64 bit platform.

The environment has worked fine in test (but the servers are not hardend).

With the production environment, any attempt to export from a report into another format (eg excel, tiff etc) results in an unexpected error within SharePoint requiring closing the browser and reopening.

There are no details behind the error. We can also find no traces of the error within any of the logs (SharePoint, Reporting Services, Windows event log etc)

When the report is opened directly from Reporting Services (ie http://servername:8080/reportserver) the report exports fine. Similarly, if the report is opened directly from Report Builder 2, or through opening Report Builder 2 from SharePoint there is no issue. This issue only happens when the report is invoked directly through SharePoint.


We can only assume that this issue has something to do with server hardening/UAC as we have

Applying SQL 2008 SP1 CU 2 in MOSS environment


Hi all,

I have a dedicated SQL 2008 x64 std edtion with SP1  for MOSS 2007 SP2, I would like to apply the CU2 for activating the lock memory page feature, I would like to know if there any incidence on the sharepoint farm after applying this CU on my SQL server?

Thank you for your feedback about that.




.net 3.5 - Compiling solely for 64 bit environment

I needed my .net project to be workable in 32 bit, 64 bit separately..core idea is 64 bit compiled exe shouldn't work on 32 bit, I am not using any unmanaged codes, its a simple application, If I set the target for compiling 64 bit machine, will this work out? if not can anybody give a solution for it?   Thanks in advance 

Databasemail error in clustered environment

Hi. I'm having trouble getting DBmail to work on a SQL 2005 SP3 STD. (64-bit) installation. I've setup database mail with the wizard. I've tested sending an e-mail using telnet -> OK!   But when I try to send a test e-mail from the sql server management studio I the message is queued, and the Windows Event Viewer logs an error like this: *************************************** Event Type: Error Event Source: DatabaseMail Event Category: None Event ID: 0 Date:  27-08-2010 Time:  10:01:23 User:  N/A Computer: <My_servername> Description: 1) Exception Information =================== Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException Message: There was an error on the connection. Reason: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified), connection parameters: Server Name: <My_servername>\<My_named_instance>, Database Name: msdb Data: System.Collections.ListDictionaryInternal TargetSite: Void OpenConnection(Microsoft.SqlServer.Management.Common.SqlConnectionInfo) HelpLink: NULL

SQL Server 2005 - Installation in Cluster Environment - "Service SQL Server Browser (SQLBrowser) fai

Windows Server 2003 R2 Enterprise Edition SP2 32-bit All updates and patches installed Two-node cluster environment configured. Cluster functions perfectly. Trying to install SQL Server 2005 Enterprise Edition (32-bit) as a clustered application. Installation proceeds fine until it begins to install the SQL Server Database Services product. Status window says "Starting Services. Service: SQL Server Browser". Error message is presented: "Service 'SQL Server Browser' (SQLBrowser) failed to start. Verify that you have sufficient privileges to start system services". SQL Server Service Account is in the Administrators group on both local systems, and is a domain account. Account used for the installation is in the Administrators group on both local systems, and is a domain account. Have cancelled out of the install and rebooted both servers numerous times. Exact same error continues to occur. Cluster is active and all resources are owned by node #1 - the node where SQL Server Installation is being run. In the event viewer, I see: Event ID: 10 Description: The SQLBrowser service was unable to establish SQL instance and connectivity discovery". I am also seeing errors like: Source: SQLBrowser. The SQL configuration for SQL is inaccessible or invalid. Source: SQLBrowser. The Configuration of the AdminConnection\TCP protocol in the SQL instance xxxxxx i

Network failure in Cluster Environment,will it stop the SQL Server Instances?

Hi All I have problem with cluster Environment that is there is network failure in Cluster Environment,will it stop SQL Server Instances Event viewrer Information 6:22:09 The MSSQLSERVER service entered the stopped state. 6:22:05 The MSSQLSERVER service was successfully sent a stop control. 6:22:04 The SQLSERVERAGENT service entered the stopped state. 6:21:43 The node lost communication with cluster node 'MSSQL0002' on network 'LAN'. 6:22:02 The SQLSERVERAGENT service was successfully sent a stop control. 6:22:02 Cluster resource 'SQL IP Address1(SQLCLUSTER)' in Resource Group 'SQL' failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'Cluster IP Address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'Cluster IP Address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'MSDTC IP address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'MSDTC IP address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'SQL IP Address1(SQLCLUSTER)' has failed. 6:21:58 The TCP/IP interface for Cluster IP Address 'SQL IP Address1(SQLCLUSTER)' has failed. 6:21:58 Cluster network 'LAN' is operational (up). All available server cluster nodes attached to the network can communicate using it. 6:21:58 The interface for cluster node 'MSSQL0002' on network 'LAN' failed. If the condition persist

How to customize workflow canvas in re-host environment?

Hi there,  Currently I'm developing a re-hosted debugger for Windows Workflow.  For the workflow canvas, I'm using View property of WorkflowDesigner class and bind my ContentControl to it.  The question here is, how to customize the WorkflowDesigner.View? Examples of customization are:   Extract the overview window, so that I can put the window in another part of the UI Change the zoom tool into the slide bar as in MS Word.   Thanks and best regards,  Arinto

Web application doesn't deployed in x 64 bit environment

We have a web application developed in vb.net ,Asp.net,XSL,XSLT,XML,SQL SERVER(framework 2.0) and it is currently working fine in 32 bit environment. We are getting following errors when we deploy our web application in Windows Server 2008 R2 Standard Edition (64 bit environment) OR when we try to convert our web application as x64 bit application by recompiling our code base in x64 bit platform(VS2005 - x64 compiler settings). Error found in HTTPERROR log: 2010-08-26 12:24:56 ::1%0 51679 ::1%0 80 HTTP/1.1 GET /webview5439/Default.aspx - 1 Connection_Abandoned_By_ReqQueue .Net+2.0+App+Pool   Error found in IIS Log: 2010-08-26 13:33:17 ::1 GET /webview5439/Default.aspx - 80 - ::1 Mozilla/4.0+ (compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5 .30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 500 22 50 1015 Also we are getting a warning msg while recompiling our code in x64 code base platform(by changing all the dll reference to framework64 path). vbc : warning BC40010: Possible problem detected while building assembly '<Project Name>': Referenced assembly 'mscorlib.dll' targets a different processor vbc : warning BC40010: Possible problem detected while building assembly '<Project Name>': Referenced assembly '

SSIS Deployment Reads local Environment Variable and not Server

Hi All, I have an SSIS package that uses an Environment variable to hold the connection string for the local SSISConfiguration table.  This works properly on my local machine.  However, when I import the package to Integration Services(through SSMS) it reads the environment variable from the local machine and not the server it is deployed to.  If I log on to the server remotely and do the same process it uses the the correct environment varible... (SQL Server 2005) Is there a way to deploy the package to the server and get it to use the correct Env variable without having to log-in to the server and import it?  Let me know if anyone is looking for additional information.   Thanks!

Preparation of local Development Environment for Windows AZURE

  The Windows Azure is the cloud services platform provided by Microsoft through Microsoft data centers. Windows Azure enables the developers to create applications running in the cloud by using Microsoft Visual Studio development environment and the Microsoft .NET Framework. In this article I am speaking about setting up a development environment that allows you to develop applications for cloud using visual studio and windows azure SDK. Prerequisites This article assumes that you already installed Visual studio 2010 and .Net framework 4 and SQL Server(Express editions of 2005 or 2008). Also you need windows vista sp1 or higher, windows 7, windows server 2008 as the OS for the development environment. This article has uses windows 7 to setup the environment. Enable IIS 7 on windows 7 You need to enable IIS 7 with ASP.Net. The steps to configure IIS 7 is as follows Navigate to start -> Control Panel ->Programs and Features. Select "Turn Windows Features On or Off". Under Internet Information Services, expand World Wide Web Services. Under Application Development Features, select ASP.NET. Under Common HTTP Features, select Static Content, the screen will look similar to the following Click OK to Install the selected features. Download windows Azure SDK You can download the windows azure SDK from msdn. Follow the link http://msdn.microsoft.com/en-us/lib

WSS 2.0 complete new environment upgrade

Hi, WE have to migrate wss 2.0 to MOSS 2007 to a completely new environment. The existing wss 2.0 has 150 sites and sizes to 23 gb. Kindly give the steps involved in this. The MOSS 2007 wil be installed in new box.KIndly help me as i am new into this
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend