473,669 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

allowDefinition =MachineToAppli cation and errors switching to VS2008 Express

We have a project working well today and it's developed
on VS2005. Since we're planing to switch to VS2008 in a
soon future, i've been trying to move the project to
VS2008 Express (Web Developer).

After i've moved over all the files, i run into problems
compiling and running it. Both versions of VS are run on
the same computer (with the sam settings, of course).
Still, when i try to run index.aspx, i get error message
as follows:

Error 95 It is an error to use a section
registered as allowDefinition ='MachineToAppl ication'
beyond application level.

It's also suggested that it might be due to that the
directory isn't configured as an application in the IIS.
What can be done to resolve it?

A guide for moving from VS2005 to VS2008 Express would
be great but i have't found one that is good. Not for
web-projects, anyway.
--
Regards
Konrad Viltersten
Jun 27 '08 #1
5 3172
re:
!when i try to run index.aspx, i get error message as follows:

!Error 95 It is an error to use a section registered as
!allowDefinitio n='MachineToApp lication' beyond application level.

There should be no conflicts when running projects based on VS 2005 in VWD 2008,
in reference to the "allowDefinitio n='MachineToApp lication' beyond application level" config.

Both the .Net Framework 2.0 and the .Net Framework 3.5 target the same v2.0.50727
base configuration files, and don't use different machine.config nor web.config files.

Did you convert the project when you first opened it in VWD 2008 ?

re:
!It's also suggested that it might be due to that the directory isn't
!configured as an application in the IIS. What can be done to resolve it?

The ASP.NET DEvelopment Server included with VWD creates a root application
when it runs your project, so that shouldn't be the root cause for your error.

I suggest you check the specific setting which is causing the problem in your web.config.

There's not too many of them:

<section name="anonymous Identification"
<section name="authentic ation"
<section name="healthMon itoring"
<section name="hostingEn vironment"
<section name="machineKe y"
<section name="membershi p"
<section name="profile"
<section name="roleManag er"
<section name="securityP olicy"
<section name="sessionSt ate"
<section name="siteMap"
<section name="trust"
<section name="urlMappin gs"
<section name="cache"
<section name="outputCac he"
<section name="outputCac heSettings"
<section name="sqlCacheD ependency"

If you are using any of those, you need to have a virtual directory,
at least, or an application, although as mentioned the dev web server
creates one for you when running your code.

Look for web.config entries which use those sections and test-delete them.
( backup the original web.config so you can restore the original settings...if needed )
....until you find the culprit...and post back your results.

Have you set index.asp as your "Start Page" for your project ?
Try setting it ( select it in the Solution Explorer, right-click and select "Set as Start Page" ).

Also, try setting the project's target to .Net Framework 2.0 in the project's property pages,
instead of the .Net Framework 3.5 ( if you don't need .Net Framework 3.5 features... ),
if you selected targeting the .Net Framework 3.5 when you converted the project.

You can always flip it back if that doesn't do anything.
All that does is change a few entries in web.config.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"K Viltersten" <tm**@vilterste n.comwrote in message news:op******** *******@lp028.p agero.local...
We have a project working well today and it's developed
on VS2005. Since we're planing to switch to VS2008 in a
soon future, i've been trying to move the project to
VS2008 Express (Web Developer).

After i've moved over all the files, i run into problems
compiling and running it. Both versions of VS are run on
the same computer (with the same settings, of course).
Still, when i try to run index.aspx, i get error message
as follows:

Error 95 It is an error to use a section
registered as allowDefinition ='MachineToAppl ication'
beyond application level.

It's also suggested that it might be due to that the
directory isn't configured as an application in the IIS.
What can be done to resolve it?

A guide for moving from VS2005 to VS2008 Express would
be great but i have't found one that is good. Not for
web-projects, anyway.
--
Regards
Konrad Viltersten
Jun 27 '08 #2
!when i try to run index.aspx, i get error message as follows:
!Error 95 It is an error to use a section registered as
!allowDefinitio n='MachineToApp lication' beyond application level.

Did you convert the project when you first opened it inVWD 2008?
I haven't been asked about any conversions. I simply opened
VWD2008 Express and opened the SLN-file containig the
solution i've been working in VS2005. It just got opened
and the only nag i got was one for converting the line breaks
to Windows format.
re:
!It's also suggested that it might be due to that the directory isn't
!configured as an application in the IIS. What can be done to resolve
it?

I suggest you check the specific setting which is causing theproblem in
your web.config.

There's not too many of them:

<section name="anonymous Identification"
<section name="authentic ation"
<section name="healthMon itoring"
<section name="hostingEn vironment"
<section name="machineKe y"
<section name="membershi p"
<section name="profile"
<section name="roleManag er"
<section name="securityP olicy"
<section name="sessionSt ate"
<section name="siteMap"
<section name="trust"
<section name="urlMappin gs"
<section name="cache"
<section name="outputCac he"
<section name="outputCac heSettings"
<section name="sqlCacheD ependency"
As far i could see, there was no "section" tags in my web.config
file. The line i'm directed to when clicking on the error
description says:

<system.web>
<customErrors defaultRedirect ="Error.aspx " mode="RemoteOnl y"/>
BELOW IS THE LINE
<authenticati on mode="Forms">
ABOVE IS THE LINE
<forms timeout="10000"/>
</authentication>
<compilation debug="true">
<assemblies>
<add assembly="Syste m.DirectoryServ ices, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= B03F5F7F11D50A3 A"/>
</assemblies>
</compilation>
</system.web>


--
Regards
Konrad Viltersten
Jun 27 '08 #3
re:
!I haven't been asked about any conversions. I simply opened VWD2008 Express
!and opened the SLN-file containing the solution i've been working in VS2005.
!It just got opened and the only nag i got was one for converting the line breaks to Windows format.

That's really odd.

Everytime I create a project in VS 2005 and later open
the .sln file with VWD, the conversion wizard runs.

re:
!As far i could see, there was no "section" tags in my web.config file.

There wouldn't be. Those sections go into the machine.config file.
What I asked you was to check whether you web.config contained references to those objects.

re:
!The line i'm directed to when clicking on the error description says:

!<authenticatio n mode="Forms">

Yes, that's the reference to <section name="authentic ation".

What authentication code do you have in your app ?
Do you have a logon page which requests credentials from your users ?

Here's a complete example to test the authentication capability you seem to be missing:

Could you create a new project in VWD, copy the 3 files
I included in web.zip into the new project and run *default.aspx*
by right-clicking it in the Solution Explorer and selecting "View in Browser" ?

....and then post back the results of your test ?

You should get prompted for authentication.
Use "tm**@vilterste n.com" for both the username and the password.

You should first be sent to login.aspx and then, after inputting the credentials above,
be redirected to login.aspx where the username "tm**@vilterste n.com" will be displayed.

In case you can't download zip files, here's the text of the files :

web.config:
-----------------
<?xml version="1.0"?>
<configuratio n>
<appSettings/>
<connectionStri ngs/>
<system.web>
<compilation debug="true" strict="false" explicit="true" >
</compilation>
<pages>
<namespaces>
<clear/>
<add namespace="Syst em"/>
<add namespace="Syst em.Collections"/>
<add namespace="Syst em.Collections. Specialized"/>
<add namespace="Syst em.Configuratio n"/>
<add namespace="Syst em.Text"/>
<add namespace="Syst em.Text.Regular Expressions"/>
<add namespace="Syst em.Web"/>
<add namespace="Syst em.Web.Caching"/>
<add namespace="Syst em.Web.SessionS tate"/>
<add namespace="Syst em.Web.Security "/>
<add namespace="Syst em.Web.Profile"/>
<add namespace="Syst em.Web.UI"/>
<add namespace="Syst em.Web.UI.WebCo ntrols"/>
<add namespace="Syst em.Web.UI.WebCo ntrols.WebParts "/>
<add namespace="Syst em.Web.UI.HtmlC ontrols"/>
</namespaces>
</pages>
<!--
The <authentication section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authenticati on mode="Forms">
<forms loginUrl="login .aspx" name=".ASPXFORM SAUTH">
</forms>
</authentication>
<authorizatio n>
<deny users="?"/>
</authorization>
</system.web>
<system.codedom >
</system.codedom>
<system.webServ er>
</system.webServe r>
</configuration>
-----------------------

default.aspx:
------------------
<%@ Page Language="VB" %>
<html>
<head>
<title>Forms Authentication - Default Page</title>
</head>

<script runat="server">
Sub Page_Load(ByVal Src As Object, ByVal e As EventArgs)
Welcome.Text = "Hello, " & Context.User.Id entity.Name
End Sub

Sub Signout_Click(B yVal sender As Object, ByVal e As EventArgs)
FormsAuthentica tion.SignOut()
Response.Redire ct("Login.aspx" )
End Sub
</script>

<body>
<h3>
Using Forms Authentication</h3>
<asp:Label ID="Welcome" runat="server" />
<form id="Form1" runat="server">
<asp:Button ID="Submit1" OnClick="Signou t_Click"
Text="Sign Out" runat="server" /><p>
</form>
</body>
</html>
------------

login.aspx:
-----------------
<%@ Page Language="VB" %>
<%@ Import Namespace="Syst em.Web.Security " %>

<script runat="server">
Sub Logon_Click(ByV al sender As Object, ByVal e As EventArgs)
If ((UserEmail.Tex t = "tm**@vilterste n.com") And _
(UserPass.Text = "tm**@vilterste n.com")) Then
FormsAuthentica tion.RedirectFr omLoginPage _
(UserEmail.Text , Persist.Checked )
Else
Msg.Text = "Invalid credentials. Please try again."
End If
End Sub
</script>

<html>
<head id="Head1" runat="server">
<title>Forms Authentication - Login</title>
</head>
<body>
<form id="form1" runat="server">
<h3>
Logon Page</h3>
<table>
<tr>
<td>
E-mail address:</td>
<td>
<asp:TextBox ID="UserEmail" runat="server" /></td>
<td>
<asp:RequiredFi eldValidator ID="RequiredFie ldValidator1"
ControlToValida te="UserEmail"
Display="Dynami c"
ErrorMessage="C annot be empty."
runat="server" />
</td>
</tr>
<tr>
<td>
Password:</td>
<td>
<asp:TextBox ID="UserPass" TextMode="Passw ord"
runat="server" />
</td>
<td>
<asp:RequiredFi eldValidator ID="RequiredFie ldValidator2"
ControlToValida te="UserPass"
ErrorMessage="C annot be empty."
runat="server" />
</td>
</tr>
<tr>
<td>
Remember me?</td>
<td>
<asp:CheckBox ID="Persist" runat="server" /></td>
</tr>
</table>
<asp:Button ID="Submit1" OnClick="Logon_ Click" Text="Log On" runat="server" />
<p>
<asp:Label ID="Msg" ForeColor="red" runat="server" />
</p>
</form>
</body>
</html>
-----------

Running those 2 pages with the web.config will tell you if
the problem is with VWD...or with your authentication code.

Please post back the results of the test, OK ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"K Viltersten" <tm**@vilterste n.comwrote in message news:op******** *******@lp028.p agero.local...
!when i try to run index.aspx, i get error message as follows:
!Error 95 It is an error to use a section registered as
!allowDefinitio n='MachineToApp lication' beyond application level.

Did you convert the project when you first opened it inVWD 2008?
I haven't been asked about any conversions. I simply opened
VWD2008 Express and opened the SLN-file containig the
solution i've been working in VS2005. It just got opened
and the only nag i got was one for converting the line breaks
to Windows format.
re:
!It's also suggested that it might be due to that the directory isn't
!configured as an application in the IIS. What can be done to resolve
it?

I suggest you check the specific setting which is causing theproblem in
your web.config.

There's not too many of them:

<section name="anonymous Identification"
<section name="authentic ation"
<section name="healthMon itoring"
<section name="hostingEn vironment"
<section name="machineKe y"
<section name="membershi p"
<section name="profile"
<section name="roleManag er"
<section name="securityP olicy"
<section name="sessionSt ate"
<section name="siteMap"
<section name="trust"
<section name="urlMappin gs"
<section name="cache"
<section name="outputCac he"
<section name="outputCac heSettings"
<section name="sqlCacheD ependency"
As far i could see, there was no "section" tags in my web.config
file. The line i'm directed to when clicking on the error
description says:

<system.web>
<customErrors defaultRedirect ="Error.aspx " mode="RemoteOnl y"/>
BELOW IS THE LINE
<authenticati on mode="Forms">
ABOVE IS THE LINE
<forms timeout="10000"/>
</authentication>
<compilation debug="true">
<assemblies>
<add assembly="Syste m.DirectoryServ ices, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= B03F5F7F11D50A3 A"/>
</assemblies>
</compilation>
</system.web>


--
Regards
Konrad Viltersten

Jun 27 '08 #4
What authentication code do you have in your app ?
Do you have a logon page which requests credentialsfrom your users?
Yes, that's what we used.
Here's a complete example to test the authenticationc apability you seem
to be missing:

Could you create a new project in VWD, copy the 3 files
I included in web.zip into the new project and run*default.asp x* by
right-clicking it in the SolutionExplore r and selecting "View in
Browser" ?
When i log in suing my e-mail i get to see the follwing
text piece.

Using Forms Authentication
Hello, tm**@viltersten .com

When i log in using other nick/password i get the red
error message as follows.

Invalid credentials. Please try again.
You should get prompted for authentication.
Use "tm**@vilterste n.com" for both the username and thepassword.

You should first be sent to login.aspx and then, afterinputting the
credentials above, be redirected tologin.aspx where the username
"tm**@vilterste n.com"will be displayed.
Yes, except that i get sent to default.aspx at the
successful login, not login.apsx. Perhaps that's what
you ment?
Running those 2 pages with the web.config will tell you if
the problem is with VWD...or with your authentication code.
Please post back the results of the test, OK ?
Well, what do you think?

--
Regards
Konrad Viltersten
Jun 27 '08 #5
re:
!Yes, except that i get sent to default.aspx at the
!successful login, not login.apsx. Perhaps that's what you ment?

Yes, that's what I meant.

re:
!When i log in suing my e-mail i get to see the follwing text piece.
!Using Forms Authentication
!Hello, tm**@viltersten .com
!When i log in using other nick/password i get the red error message as follows.
!Invalid credentials. Please try again.
!Well, what do you think?

That means that you don't have a problem with whether authentication works or not.

As the example shows, authentication works when you create a new project in VWD
and run it with the development server, even if the project is not marked as an application.

It looks like you have a problem with your application's configuration,
inherited from your old project, especially since you say you did not
convert the project to VWD 2008 ( which you should have been prompted to do ).

What I'd suggest is for you to create a new project in VWD,
and add your old project's files one by one with "Add existing item".

Whatever the problem is with your application's configuration should go away that way.
From then on, you should be able to continue developing the app in the new project.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"K Viltersten" <tm**@vilterste n.comwrote in message news:op******** *******@lp028.p agero.local...
>What authentication code do you have in your app ?
Do you have a logon page which requests credentialsfrom your users?

Yes, that's what we used.
>Here's a complete example to test the authentication capability you seem to be missing:

Could you create a new project in VWD, copy the 3 files
I included in web.zip into the new project and run*default.asp x* by right-clicking it in the SolutionExplore r and
selecting "View in Browser" ?

When i log in suing my e-mail i get to see the follwing
text piece.

Using Forms Authentication
Hello, tm**@viltersten .com

When i log in using other nick/password i get the red
error message as follows.

Invalid credentials. Please try again.
>You should get prompted for authentication.
Use "tm**@vilterste n.com" for both the username and thepassword.

You should first be sent to login.aspx and then, afterinputting the credentials above, be redirected tologin.aspx
where the username "tm**@vilterste n.com"will be displayed.

Yes, except that i get sent to default.aspx at the
successful login, not login.apsx. Perhaps that's what
you ment?
>Running those 2 pages with the web.config will tell you if
the problem is with VWD...or with your authentication code.
Please post back the results of the test, OK ?

Well, what do you think?

--
Regards
Konrad Viltersten

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
114374
by: Alex D. | last post by:
I upgraded one of my applications to beta 2. conversion seemed to work OK, problem is when trying to build I get an error like: it is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. this error is pointing to this section in my web.config: <authentication mode="Forms">
3
12601
by: Boonaap | last post by:
I have been looking around on different sites and fora, and i have a similar problem than some people had before... it is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. this is the solution i've read (almost everywhere) "You need to create an application or a virtual directory ( with...
3
5572
by: Patrick Paquin | last post by:
Hi, I have an application ("appls") on my website. This application is a subfolder of the website root. This subfolder is configured as an application in the IIS Manager When I want precompile my application with the command line C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -v /appls -p "E:\Sites WWW\devlappl.intracger", I get this message :
23
5091
by: deathtospam | last post by:
A day or two ago, I wrote a quick ASPX page with a CS codebehind using Visual Studio .NET 2005 -- it worked, I saved it and closed the project. Today, I came back to the project, reopened the solution, and was greeted with the following error: ======================================================================== It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error...
4
554
by: K Viltersten | last post by:
We have a project working well today and it's developed on VS2005. Since we're planing to switch to VS2008 in a soon future, i've been trying to move the project to VS2008 Express (Web Developer). After i've moved over all the files, i run into problems compiling and running it. Both versions of VS are run on the same computer (with the sam settings, of course). Still, when i try to run index.aspx, i get error message as follows:
1
6609
by: jc | last post by:
RE: It is an error to use a section registered as allowDefinition='MachineToApplication' There's an asp.net 1.1 vb.net vs 2003 solution under a virtual directory on one of our sites. I can see the solution and project files in under the folder where the IIS virtual directory is pointing. The solution is working fine.
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8809
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.