Solution for CS0016 Error on ASP.NET and IIS7

by Vahid 13. January 2009 16:37

if you are also new to IIS7 like me and have tried to deploy an ASP.net web site to IIS7, you must have faced the same problem i was facing which was so annoying. i was trying to deploy a web application to IIS7 running on vista home premium. deployment was ok, but when i was trying to access the site i was receiving the following error

image

BuzzNet Tags: ,,

CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\… ‘Access is denied.’

i had no clue why this was happening as everything seemed to be ok for me.

So, I figured, “OK this is probably a permissions issue” as I have encountered similar before in XP, where the ASPNET user account needed to be added. I also know that in Vista this account is called “NETWORK SERVICE”. I then update the permissions for the “Temporary ASP.NET Files” folder in the .NET Framework folder, eagerly get back to my browser, hit F5.. Boom. No dice, same error message.

After doing some digging on the Internet I found out that

I also need to set the permissions for the C:\Windows\Temp folder!

To resolve, ensure your permissions are correct for both temp directories:

  • Browse to “C:\Windows\Microsoft.NET\Framework\{Vers.}\”.
  • Right click the “Temporary ASP.NET Files” folder.
  • Click “Properties”.
  • Click the “Security” tab.
  • Click “Edit” and confirm the UAC prompt.
  • Click the “Add” button.
  • In the “Enter Object Name” field, enter “NETWORK SERVICE”.
  • Click “Check Names”, it should become underlined to confirm it is OK.
  • Click OK.
  • With the “NETWORK SERVICE” user selected, in the "Permissions for..” list, check the “Full Control – Allow” check box.
  • Click “Apply” and “Yes” to the security prompt.
  • Finally click “OK” to close the properties dialog.
  • Repeat the above steps on the “C:\Windows\Temp” folder as well! (i.e. browse to “C:\Windows”, right click “Temp”, click “Properties” etc. etc.).

security setting1

To be honest, I wasn’t sure I believed it at first. But I deleted all temp files from both folders and reset/removed the permissions, and the error reared its ugly head again.

I hope this helps any others with the same problem save time!

Tags:

.Net | Technical

Know more about Representational state transfer (REST)

by Vahid 13. January 2009 13:42

i am sure these you hear about REST, so want to know what rest is? then have a look at the following definition

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. As such, it is not strictly a method for building "web services." The terms “representational state transfer” and “REST” were introduced in 2000 in the doctoral dissertation of Roy Fielding, one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification.

REST strictly refers to a collection of network architecture principles which outline how resources are defined and addressed. The term is often used in a looser sense to describe any simple interface which transmits domain-specific data over HTTP without an additional messaging layer such as SOAP or session tracking via HTTP cookies. These two meanings can conflict as well as overlap. It is possible to design a software system in accordance with Fielding’s REST architectural style without using HTTP and without interacting with the World Wide Web.It is also possible to design simple XML+HTTP interfaces which do not conform to REST principles, and instead follow a model of remote procedure call. The difference between the uses of the term “REST” therefore causes some confusion in technical discussions.

here are some good links to know REST better

Tags:

Technical

Base Class Library Samples

by Vahid 13. January 2009 13:30

i found a set of usefull samples for .net BCL (base class library). you can take them at the following link:

 

http://msdn.microsoft.com/en-us/netframework/aa569267.aspx

Tags: ,

.Net | Technical

Sort based on input parameter in oracle query.

by Vahid 10. January 2009 09:15
Today I was tracing a defect happened in a stored procedure with paging functionality. After spending sometimes on it I came to know that sorting does not work properly. In the order by clause of the procedure we were using an input parameter which holds the column name based on which the result was to be sorted. But it seems that oracle and pl-sql does not support this feature and if we want to sort based on an input parameter we have to go for dynamic query which I don’t like at all.But it's funny that the feature is not there in oracle because the same thing can be done in ms sql server easily.Anyone got some idea about this, please let me know.

 

Tags: ,

Technical

IsNumeric() function in C#?

by Vahid 3. January 2009 05:36

hi,

as you may know c# is missing the nice and usfull IsNumeric function which is available in VB.net. but it is a trivial task to implement a generic equvelant function for it. look at the following code. it will return true if the value is numeric and false if the value is false.

static bool IsNumeric(object value)

{

double retNum;return Double.TryParse(Convert.ToString(value), System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum);

}

 

Tags: ,

Technical | .Net

HR Manager story

by Vahid 1. January 2009 18:59
One day while walking down the street a highly successfulHuman Resources Manager was tragically hit by a bus and she died. Her soul arrived up in heaven where she was met at the Pearly Gates by St. Peter himself.  "Welcome to Heaven," said St. Peter. "Before you get settled in though, it seems we have a problem. You see, strangely enough, we've never once had a Human Resources Manager make it this far and we're not really sure what to do with you."  "No problem, just let me in," said the woman. "Well, I'd like to, but I have higher orders. What we're going to do is let you have a day in Hell and a day in Heaven and then you can choose whichever one you want to spend an eternity in."  "Actually, I think I've made up my mind, I prefer to stay in Heaven", said the woman "Sorry, we have rules..." And with that St. Peter put the executive in an elevator and it went down-down-down to hell.  The doors opened and she found herself stepping out onto the putting green of a beautiful golf course. In the distance was a country club and standing in front of her were all her friends - fellow executives that she had worked with and they were well dressed in evening gowns and cheering for her. Th! ey ran up and kissed her on both cheeks and they talked about old times. They played an excellent round of golf and at night went to the country club where she enjoyed an excellent steak and lobster dinner.  She met the Devil who was actually a really nice guy (kindof cute) and she had a great time telling jokes and dancing. She was having such a good time that before she knew it, it was time to leave. Everybody shook her hand and waved goodbye as she got on the elevator.  The elevator went up-up-up and opened back up at the Pearly Gates and found St. Peter waiting for her. "Now it's time to spend a day in heaven," he said. So she spent the next 24 hours lounging around on clouds and playing the harp and singing. She had great time and before she knew it her 24 hours were up and St. Peter came and got her.  "So, you've spent a day in hell and you've spent a day in heaven. Now you must choose your eternity," The woman paused for a second and then replied, "Well, I never thought I'd say this, I mean, Heaven has been really great and all, but I think I had a better time in Hell."  So St. Peter escorted her to the elevator and again she went down-down-down back to Hell. When the doors of the elevator opened she found herself standing in a desolate wasteland covered in garbage and filth. She saw her friends were dressed in rags and were picking up the garbage and putting it in sacks.  The Devil came up to her and put his arm around her. "I don't understand," stammered the woman, "yesterday I was here and there was a golf course and a country club and we ate lobster and we danced and had a great time. Now all there is a wasteland of garbage and all my friends look miserable."  The Devil looked at her smiled and told...  

"Yesterday we were recruiting you, today you're an Employee"

Tags:

General

XML Tools

by Vahid 25. December 2008 20:36

working extensively on XML these days, i was in need a good tool which has the ability to evaluate XPath queries. i have been using XML Notepad for a long time and really like the tool but there is not feature in the tool to evaluate Xpath queries. searching around i found XML Explorer. the tool supports so many functions and it is really fast. You need to work on xml like me, take the tools from here

 

http://www.codeplex.com/xmlexplorer

http://www.codeplex.com/xmlnotepath

Tags: ,

Technical

History Lesson

by Vahid 24. December 2008 18:48

Have a history teacher explain this----- if they can.

Abraham Lincoln was elected to Congress in 1846.

John F. Kennedy was elected to Congress in 1946.

Abraham Lincoln was elected President in 1860.

John F. Kennedy was elected President in 1960.

Both were particularly concerned with civil rights.

Both wives lost their children while living in the White House.

Both Presidents were shot on a Friday.

Both Presidents were shot in the head.

Now it gets really weird.

Lincoln 's secretary was named Kennedy.

Kennedy's Secretary was named Lincoln .

Both were assassinated by Southerners.

Both were succeeded by Southerners named Johnson.

Andrew Johnson, who succeeded Lincoln , was born in 1808.

Lyndon Johnson, who succeeded Kennedy, was born in 1908.

John Wilkes Booth, who assassinated Lincoln, was born in 1839.

Lee Harvey Oswald, who assassinated Kennedy, was born in 1939.

Both assassins were known by their three names.

both names are composed of fifteen letters.

Now hang on to your seat.

Lincoln was shot at the theater named 'Ford.'

Kennedy was shot in a car called ' Lincoln ' made by 'Ford.'

Lincoln was shot in a theater and his assassin ran and hid in a warehouse.

Kennedy was shot from a warehouse and his assassin ran and hid in a theater.

Booth and Oswald were assassinated before their trials.

And here's the kicker...

A week before Lincoln was shot, he was in Monroe, Maryland

A week before Kennedy was shot, he was with Marilyn Monroe.

Creepy huh?

 

Tags:

General

Bush Security Upgraded

by Vahid 21. December 2008 16:15

Tags:

General

سوال و جواب های مهم زندگی

by Vahid 20. December 2008 04:29

چرا روی آدرس اینترنت به جای یک دبلیو؛سه تا دبلیو می گذارند ؟ چون کار از محکم کاری عیب نمی کند!

۲- اگر اسکلت از بالای دیوار بپرد پایین چه می شود ؟ هیچ وقت این کار را نمیکند چون جیگر ندارد!

۳- چرا مار نمی تواند به مسافرت برود ؟ چون دست ندارد که برای خداحافظی تکان دهد!

۴- برای قطع جریان برق چه باید کرد ؟ باید قبض آن را پرداخت نکرد!

۵- نصف النهار چیست ؟ همان شام است که در واقع نصف نهار است که برای شام مانده است!

۶- آخرین دندانی که در دهان دیده می شود چه نام دارد؟ دندان مصنوعی!

۷- چرا دوچرخه خودش نمی تواند به ایستد؟ چون خیلی خسته است!

۸- اگر کسی قلبش ایستاده بود چه می کنید؟ برایش صندلی می گذاریم !

۹- دارچین رو چگونه درست می شود؟ وقتی یک چینی را دار بزنند!

۱۰- چرا لک لک موقع خواب یک پایش را بالا می گیرد ؟ چون اگر هر دو تا رو بالا بگیرد ؛ می افتد!

۱۱- اگر شخصی خیلی سر شناس باشد ؛ به نظر شما چه کاره است ؟ آرایشگر!

۱۲- اگر تلویزیون روشن نشد چه می کنید ؟ آن را هل می دهیم و می زنیم کانال دو!

۱۳- شباهت دماسنج با ورقه ی امتحان در چیست؟ هر دو وقتی به صفر می رسند آدم می لرزد!

۱۴- چرا دود از دودکش بالا می رود ؟ چون ظاهرا چاره ی دیگری ندارد!

۱۵- شباهت نون سوخته با آدم غرق شده چیست ؟ هر دو تاشونو دیر کشیدن بیرون!

۱۶- فرق یخمک با آتروپات در چیست؟ یخمک خوشمزه تر است!

۱۷- فرق باتری با مادر زن در چیست ؟ باتری حداقل یک قطب مثبت دارد اما مادر زن هیچ چیز مثبتی ندارد!

۱۸- اختراعی که برای جبران اشتباهات بشر درست شده است چیست ؟ طلاق!

۱۹- چه طوری زیر دریایی رو غرق می کنند؟ یه غواص میره در میزنه !

۲۰- ناف چیست؟ ناف نمره ی صفری است که طبیعت به شکم بی هنر داده است!

۲۱- خط وسط قرص برای چیه ؟ برای این که اگر با آب پایین نرفت با پیچگوشتی بره !

۲۲- یک نفر چگونه یک پرنده رو می کشد؟ آن را از بالای یک صخره به پایین پرتاب می کند

Tags:

General | Persian