<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Configuration and Deployment</title><link>http://forums.asp.net/26.aspx</link><description>Configuring and deploying ASP.NET applications - web.config, \bin, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Read file not working after deploying to IIS 7</title><link>http://forums.asp.net/thread/3273183.aspx</link><pubDate>Fri, 03 Jul 2009 09:36:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273183</guid><dc:creator>Thomas Sun – MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273183.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=26&amp;PostID=3273183</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Where is the file that&amp;nbsp;you are trying to access from your project? Please make sure the file&amp;nbsp;path is correct and your application process identity has permission on that file.&lt;/p&gt;
&lt;p&gt;Since your application is running under IIS, ASP.NET process identity is &amp;quot;ASPNET&amp;quot; or &amp;quot;NETWORK SERVICE&amp;quot; depending on IIS version by default. In your case, it should be &amp;quot;NETWORK SERVICE&amp;quot;.&lt;/p&gt;
&lt;p&gt;In your case, please make sure we grant proper permissions to the account on the file. You can follow this article (&lt;a href="http://www.asp.net/learn/whitepapers/denied-access-to-iis-directories/"&gt;http://www.asp.net/learn/whitepapers/denied-access-to-iis-directories/&lt;/a&gt;) to implement it.&lt;/p&gt;
&lt;p&gt;For testing, we can try to grant proper permissions to &amp;quot;EVERYONE&amp;quot; on that file to see if it works.&lt;/p&gt;
&lt;p&gt;If the file is within your application directory, I suggest you use Server.MapPath Method (&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx&lt;/a&gt;) to get its path.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;I look forward to hearing from you.&lt;/p&gt;</description></item><item><title>Re: Read file not working after deploying to IIS 7</title><link>http://forums.asp.net/thread/3265336.aspx</link><pubDate>Tue, 30 Jun 2009 01:52:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3265336</guid><dc:creator>bagustri</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3265336.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=26&amp;PostID=3265336</wfw:commentRss><description>&lt;p&gt;@Jeff &amp;amp; Hosting&lt;/p&gt;&lt;p&gt;Thanks for clearing that up, but might I ask what account name I should be giving permission to? &amp;nbsp;I can&amp;#39;t seem to find any account names with ASP or ASP.NET in it. &lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="text-decoration:line-through;"&gt;If I were to guess, I would guess the IIS_IUSRS account. &amp;nbsp;Would that be correct? &amp;nbsp;The server admin is on leave so there&amp;#39;s nobody around to advise me on this.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;FYI, the server is running Windows Server 2008.&lt;/p&gt;&lt;p&gt;Edit:&lt;/p&gt;&lt;p&gt;I had not modified any permissions yet, but I&amp;#39;ve been tampering with my paths and found something odd.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve been using Path.GetFullPath() to get to my Content folder. &amp;nbsp;&lt;br /&gt;If I comment this line and replace it with a hard-coded path (F:\\Path\\To\\Content) everything works. &amp;nbsp;But this would of course be bad practice. Interestingly, one would assume that Path.GetFullPath() would give the correct path as the name implies, though this didn&amp;#39;t seem to be the case for me.&lt;/p&gt;&lt;p&gt;Curious, I looked around and found out about the System.AppDomain.CurrentDomain.BaseDirectory property. &amp;nbsp;Tried it, and it also works fine. &amp;nbsp;Would this be an acceptable solution in my case?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Read file not working after deploying to IIS 7</title><link>http://forums.asp.net/thread/3265120.aspx</link><pubDate>Mon, 29 Jun 2009 20:44:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3265120</guid><dc:creator>HostingASPNet</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3265120.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=26&amp;PostID=3265120</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Jeff is right and you should give a write permission of ASP.NET account.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</description></item><item><title>Re: Read file not working after deploying to IIS 7</title><link>http://forums.asp.net/thread/3265053.aspx</link><pubDate>Mon, 29 Jun 2009 19:58:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3265053</guid><dc:creator>jeff@zina.com</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3265053.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=26&amp;PostID=3265053</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;bagustri:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;The CMS is built, and is running well. &amp;nbsp;On localhost.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;And, I assume, in the Visual Studio environment.&amp;nbsp; IIS runs under the ASP.NET process account.&amp;nbsp; Visual Studio runs under the logged in user.&amp;nbsp; Change the file/folder permissions to allow the correct account access.&lt;/p&gt;&lt;p&gt;Jeff&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Read file not working after deploying to IIS 7</title><link>http://forums.asp.net/thread/3264957.aspx</link><pubDate>Mon, 29 Jun 2009 18:54:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3264957</guid><dc:creator>bagustri</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3264957.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=26&amp;PostID=3264957</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;&lt;p&gt;I am building a simple file-driven CMS application. &amp;nbsp;&lt;br /&gt;The pieces that make up a final page are stored as regular html files, and are stored in a fixed folder structure.&lt;br /&gt;Each file that is required by a final page is read from said folders and placed into the template file (which is also read from file).&lt;/p&gt;&lt;p&gt;Everything works as it should when running from VS/localhost. &amp;nbsp;However, as soon as I deploy it to my local IIS and access the site via IP, it breaks on the very first instance of a file read.&lt;/p&gt;&lt;p&gt;I have read that this is due to some security/permission issue, which doesn&amp;#39;t allow files to be read/written to under certain conditions.&lt;/p&gt;&lt;p&gt;I can&amp;#39;t say I fully understand the issue, therefore I seek your kind help in enlightening me, if there is a way for me to get around this issue? &amp;nbsp;&lt;br /&gt;The CMS is built, and is running well. &amp;nbsp;On localhost. &amp;nbsp;Now that it is on a proper server, the most basic functionality (reading files) is broken.&lt;/p&gt;&lt;p&gt;Any help will me much appreciated. &amp;nbsp;Thank you beforehand.&lt;/p&gt;</description></item></channel></rss>