Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Troubleshooting .NET Framework Targeting Errors

Posted on 2010-11-10
9
Medium Priority
?
1,420 Views
Last Modified: 2013-11-17
Hi My site was working http://www.unesco.ca and now is not working after I did the following in my Visual Studio 2010

The Web project ‘ftp://ftp.unesco.ca ’ is targeting “.netframework, version =v2.0’, which is not installed on this machince. You must download this framework, as well as .net framework 3.5, in order to open and build this project. In order to proceed, you must select an option below

( x) retarget the project to .net framework 4. After the project opens, you can retarget it to another framework or profile.
(  ) take me to the framework download web site
( ) leave the project as unloaded.

[ ] Do not ask me again during this operation.

I've chooose X Retarget... So now it's now working and it giving me the following errors How I can fixed back to 2.0

 Please advice...

http://www.unesco.ca


=================================

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'targetFramework'.

Source Error:


Line 12:           debugging ASP.NET files.
Line 13:     -->
Line 14:             <compilation defaultLanguage="vb" debug="true" targetFramework="4.0"/>
Line 15:             <!--  CUSTOM ERROR MESSAGES
Line 16:           Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
 

Source File: E:\inetpub\wwwroot\UNESCO\web.config    Line: 14
0
Comment
Question by:elieazzi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
9 Comments
 

Author Comment

by:elieazzi
ID: 34104178
This my web.config file.



<?xml version="1.0"?>
<configuration>
	<appSettings>
		<add key="XmlFilePath" value="./menu.xml"/>
	</appSettings>
	<system.web>
		<!--  DYNAMIC DEBUG COMPILATION
          Set compilation debug="true" to insert debugging symbols (.pdb information)
          into the compiled page. Because this creates a larger file that executes
          more slowly, you should set this value to true only when debugging and to
          false at all other times. For more information, refer to the documentation about
          debugging ASP.NET files.
    -->
		<compilation defaultLanguage="vb" debug="true" targetFramework="4.0"/>
		<!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. 
          Add <error> tags for each of the errors you want to handle.
    -->
		<customErrors mode="Off"/>
		<!--  AUTHENTICATION 
          This section sets the authentication policies of the application. Possible modes are "Windows", 
          "Forms", "Passport" and "None"
    -->
		<authentication mode="None"/>
		<!--  AUTHORIZATION 
          This section sets the authorization policies of the application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous 
          (unauthenticated) users.
    -->
		<authorization>
			<allow users="*"/>
			<!-- Allow all users -->
			<!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
		</authorization>
		<!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every page within an application. 
          Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
          trace information will be displayed at the bottom of each page.  Otherwise, you can view the 
          application trace log by browsing the "trace.axd" page from your web application
          root. 
    -->
		<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
		<!--  SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests belong to a particular session. 
          If cookies are not available, a session can be tracked by adding a session identifier to the URL. 
          To disable cookies, set sessionState cookieless="true".
    -->
		<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="20"/>
		<!--  GLOBALIZATION
          This section sets the globalization settings of the application. 
    -->
		<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
		<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
</configuration>

Open in new window

0
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 2000 total points
ID: 34104659
Change this line:
<compilation defaultLanguage="vb" debug="true" targetFramework="4.0"/>

to this:

<compilation defaultLanguage="vb" debug="true" />
0
 

Author Comment

by:elieazzi
ID: 34104768
I've chagned now i'm having this error

Line 56:     -->
Line 57:             <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
Line 58:             <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
Line 59: </configuration>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:elieazzi
ID: 34104771
i did it but i'm having the following errors
Line 56:     -->
Line 57: 		<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
Line 58: 		<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
Line 59: </configuration>

Open in new window

0
 

Author Comment

by:elieazzi
ID: 34104923
are u there ?
0
 

Author Comment

by:elieazzi
ID: 34105053
As a I  try, right click your website >> Property Pages >> Build >> change "Target Framework" to .NET Framework 4.0

I only see 4.0 I'm not able to see 2.0 or 3.5 Any solutions?
0
 

Author Comment

by:elieazzi
ID: 34106120
Hi Dan,

I've removed the following code.


Line 58:             <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

What this mean ? Now it's working please advice....
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
		</system.web>

Open in new window

0
 

Author Closing Comment

by:elieazzi
ID: 34124102
Please answer my comments. thank you for your time.
0
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 34124129
Sorry.  Took Veteran's Day off.
When you target 3.5 or above, it puts a bunch of stuff in the Web.config.  As a result, you will not be able to use that very web.config for 2.0 builds.  

One thing you might want to do is clear out the web.config of anything that refers to 3.5 or as another possibility, create a blank project with 2.0 as the target and use that web.config as a model for the web.config you need.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question