Link to home
Start Free TrialLog in
Avatar of wiggy353
wiggy353

asked on

.NET 4.0 Framwork problem

I am having problems with code as simple as this:

   protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("Current User: <strong>" + System.Environment.UserName + "</strong><br><br>");
        Response.Write("Current User: <strong>" + HttpContext.Current.User.Identity.Name.ToString() + "</strong>");
    }

Open in new window


If I have it on an application pool that uses .NET 2.0, it works fine. If I change the .NET to 4.0 it doesn't work any more.

Please help.
Avatar of Rovastar
Rovastar
Flag of United Kingdom of Great Britain and Northern Ireland image

what is "doesn't work any more"? errors?
Avatar of wiggy353
wiggy353

ASKER

I change it to 4.0 application pool and reload the page and get this:

Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
The only thing I change in IIS is the version of .NET that the application pool is using and then I get the error mentioned above. What could be causing this?
ASKER CERTIFIED SOLUTION
Avatar of wiggy353
wiggy353

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I found this answer somewhere else.