All New IIS virtual directories with ASP.NET throw exception "initial character not valid"

Discussion in 'ASP .Net' started by Pao, Apr 4, 2007.

  1. Pao

    Pao Guest

    Hi all

    For all NEW sites (virtual directories) that I create, I receive
    always the same error:
    (I translate so may be a little different)

    Impossible to visualize the XML page
    Impossible to visualize the XML input through the XSL sheet. Correct
    the error, then click on Update, or try another time.


    --------------------------------------------------------------------------------

    Name with initial character not valid. Error during the elaboration of
    the
    resource "http://localhost/ricevute/default.aspx...

    <%@ Page Language="C#" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
    -^


    I already tried to register with aspnet_regiis.exe -i
    and already tried to reinstall the framework 2.0
    but nothing to do...

    IMPORTANT
    Notice that the old directories that I already have with asp.net sites
    are running well... I didn't found any support for this problem
    anywhere...
    Pao, Apr 4, 2007
    #1
    1. Advertising

  2. On Apr 4, 10:07 am, "Pao" <> wrote:
    > Hi all
    >
    > For all NEW sites (virtual directories) that I create, I receive
    > always the same error:
    > (I translate so may be a little different)
    >
    > Impossible to visualize the XML page
    > Impossible to visualize the XML input through the XSL sheet. Correct
    > the error, then click on Update, or try another time.
    >
    > ---------------------------------------------------------------------------­-----
    >
    > Name with initial character not valid. Error during the elaboration of
    > the
    > resource "http://localhost/ricevute/default.aspx...
    >
    > <%@ Page Language="C#" AutoEventWireup="true"
    > CodeFile="Default.aspx.cs" Inherits="_Default" %>
    > -^
    >
    > I already tried to register with aspnet_regiis.exe -i
    > and already tried to reinstall the framework 2.0
    > but nothing to do...
    >
    > IMPORTANT
    > Notice that the old directories that I already have with asp.net sites
    > are running well... I didn't found any support for this problem
    > anywhere...


    Is your virtual directory configured as an application in IIS or not?
    If yes, I would check an Application Settings in IIS (virt.directory -
    properties) and ASP.NET tab. Do you have all files in the right place
    (/BIN, web.config)?
    Alexey Smirnov, Apr 4, 2007
    #2
    1. Advertising

  3. Pao

    Pao Guest


    >
    > Is your virtual directory configured as an application in IIS or not?
    > If yes, I would check an Application Settings in IIS (virt.directory -
    > properties) and ASP.NET tab. Do you have all files in the right place
    > (/BIN, web.config)?- Hide quoted text -
    >


    Yes, the virtual directory is configured as application in IIS.
    But in the directory there isn't any BIN directory or web.config file.

    When I create a virtual directory as an application in IIS, and then I
    open it with Visual Web Developer, I see a message saying that the
    directory is not configured to work with asp.net, and Vis Web Dev ask
    if I want to configure it now.
    I answer Yes and I wait for a while, but no BIN directory and
    web.config files are created, and if I run a page (show in browser) I
    get the error.
    Pao, Apr 4, 2007
    #3
  4. Pao

    Pao Guest

    On Apr 4, 11:05 am, "Pao" <> wrote:
    > > Is your virtual directory configured as an application in IIS or not?
    > > If yes, I would check an Application Settings in IIS (virt.directory -
    > > properties) and ASP.NET tab. Do you have all files in the right place
    > > (/BIN, web.config)?- Hide quoted text -

    >
    > Yes, the virtual directory is configured as application in IIS.
    > But in the directory there isn't any BIN directory or web.config file.
    >
    > When I create a virtual directory as an application in IIS, and then I
    > open it with Visual Web Developer, I see a message saying that the
    > directory is not configured to work with asp.net, and Vis Web Dev ask
    > if I want to configure it now.
    > I answer Yes and I wait for a while, but no BIN directory and
    > web.config files are created, and if I run a page (show in browser) I
    > get the error.


    I also tried to copy the content of a directory that works well to my
    new directory.
    I open IIS and all settings seem good
    (- asp.net enabled version 2.0.50727
    - virtual directory correct
    - file location corresponding to the correct web.config file)
    I try to open it with IE but I get the same error (initial character
    not valid)
    Pao, Apr 4, 2007
    #4
  5. On Apr 4, 11:05 am, "Pao" <> wrote:
    > Yes, the virtual directory is configured as application in IIS.
    > But in the directory there isn't any BIN directory or web.config file.


    Okay, this is the reason.

    > When I create a virtual directory as an application in IIS, and then I
    > open it with Visual Web Developer, I see a message saying that the
    > directory is not configured to work with asp.net, and Vis Web Dev ask
    > if I want to configure it now.
    > I answer Yes and I wait for a while, but no BIN directory and
    > web.config files are created, and if I run a page (show in browser) I
    > get the error.


    Please follow these instructions

    How to: Create IIS Virtual Directories in Visual Web Developer
    http://msdn2.microsoft.com/en-us/library/d6cw6cfs(VS.80).aspx

    You might need to delete the existing virtual directory in IIS and re-
    create it in VWD
    Alexey Smirnov, Apr 4, 2007
    #5
  6. On Apr 4, 11:17 am, "Pao" <> wrote:
    > On Apr 4, 11:05 am, "Pao" <> wrote:
    >
    > > > Is your virtual directory configured as an application in IIS or not?
    > > > If yes, I would check an Application Settings in IIS (virt.directory -
    > > > properties) and ASP.NET tab. Do you have all files in the right place
    > > > (/BIN, web.config)?- Hide quoted text -

    >
    > > Yes, the virtual directory is configured as application in IIS.
    > > But in the directory there isn't any BIN directory or web.config file.

    >
    > > When I create a virtual directory as an application in IIS, and then I
    > > open it with Visual Web Developer, I see a message saying that the
    > > directory is not configured to work with asp.net, and Vis Web Dev ask
    > > if I want to configure it now.
    > > I answer Yes and I wait for a while, but no BIN directory and
    > > web.config files are created, and if I run a page (show in browser) I
    > > get the error.

    >
    > I also tried to copy the content of a directory that works well to my
    > new directory.
    > I open IIS and all settings seem good
    > (- asp.net enabled version 2.0.50727
    > - virtual directory correct
    > - file location corresponding to the correct web.config file)
    > I try to open it with IE but I get the same error (initial character
    > not valid)


    <%@ Page ... CodeFile="Default.aspx.cs" Inherits="_Default" %>

    The code above means that you use a code-behind. When you deploy your
    application, you are required to deploy the assembly DLL to the Bin
    folder. If you use global.asax and web.config, you are required to
    deploy these files too.
    Alexey Smirnov, Apr 4, 2007
    #6
  7. Pao

    Pao Guest

    On Apr 4, 11:30 am, "Alexey Smirnov" <> wrote:
    > On Apr 4, 11:17 am, "Pao" <> wrote:
    >
    >
    >
    >
    >
    > > On Apr 4, 11:05 am, "Pao" <> wrote:

    >
    > > > > Is your virtual directory configured as an application in IIS or not?
    > > > > If yes, I would check an Application Settings in IIS (virt.directory -
    > > > > properties) and ASP.NET tab. Do you have all files in the right place
    > > > > (/BIN, web.config)?- Hide quoted text -

    >
    > > > Yes, the virtual directory is configured as application in IIS.
    > > > But in the directory there isn't any BIN directory or web.config file.

    >
    > > > When I create a virtual directory as an application in IIS, and then I
    > > > open it with Visual Web Developer, I see a message saying that the
    > > > directory is not configured to work with asp.net, and Vis Web Dev ask
    > > > if I want to configure it now.
    > > > I answer Yes and I wait for a while, but no BIN directory and
    > > > web.config files are created, and if I run a page (show in browser) I
    > > > get the error.

    >
    > > I also tried to copy the content of a directory that works well to my
    > > new directory.
    > > I open IIS and all settings seem good
    > > (- asp.net enabled version 2.0.50727
    > > - virtual directory correct
    > > - file location corresponding to the correct web.config file)
    > > I try to open it with IE but I get the same error (initial character
    > > not valid)

    >
    > <%@ Page ... CodeFile="Default.aspx.cs" Inherits="_Default" %>
    >
    > The code above means that you use a code-behind. When you deploy your
    > application, you are required to deploy the assembly DLL to the Bin
    > folder. If you use global.asax and web.config, you are required to
    > deploy these files too.- Hide quoted text -
    >
    > - Show quoted text -


    Already tried, copying all the content of the working web site on the
    new web site, including web.config and BIN folder. Nothing to do.
    Thank you for the link about creating a web application with visual
    web developer; I tried it and it seems to work fine; but if I look
    better,
    no web.config neither BIN directory are created, and if I click the
    "view in browser button" I get the same error.
    Pao, Apr 4, 2007
    #7
  8. On Apr 4, 11:50 am, "Pao" <> wrote:
    > On Apr 4, 11:30 am, "Alexey Smirnov" <> wrote:
    >
    >
    >
    >
    >
    > > On Apr 4, 11:17 am, "Pao" <> wrote:

    >
    > > > On Apr 4, 11:05 am, "Pao" <> wrote:

    >
    > > > > > Is your virtual directory configured as an application in IIS or not?
    > > > > > If yes, I would check an Application Settings in IIS (virt.directory -
    > > > > > properties) and ASP.NET tab. Do you have all files in the right place
    > > > > > (/BIN, web.config)?- Hide quoted text -

    >
    > > > > Yes, the virtual directory is configured as application in IIS.
    > > > > But in the directory there isn't any BIN directory or web.config file.

    >
    > > > > When I create a virtual directory as an application in IIS, and then I
    > > > > open it with Visual Web Developer, I see a message saying that the
    > > > > directory is not configured to work with asp.net, and Vis Web Dev ask
    > > > > if I want to configure it now.
    > > > > I answer Yes and I wait for a while, but no BIN directory and
    > > > > web.config files are created, and if I run a page (show in browser) I
    > > > > get the error.

    >
    > > > I also tried to copy the content of a directory that works well to my
    > > > new directory.
    > > > I open IIS and all settings seem good
    > > > (- asp.net enabled version 2.0.50727
    > > > - virtual directory correct
    > > > - file location corresponding to the correct web.config file)
    > > > I try to open it with IE but I get the same error (initial character
    > > > not valid)

    >
    > > <%@ Page ... CodeFile="Default.aspx.cs" Inherits="_Default" %>

    >
    > > The code above means that you use a code-behind. When you deploy your
    > > application, you are required to deploy the assembly DLL to the Bin
    > > folder. If you use global.asax and web.config, you are required to
    > > deploy these files too.- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Already tried, copying all the content of the working web site on the
    > new web site, including web.config and BIN folder. Nothing to do.
    > Thank you for the link about creating a web application with visual
    > web developer; I tried it and it seems to work fine; but if I look
    > better,
    > no web.config neither BIN directory are created, and if I click the
    > "view in browser button" I get the same error.- Hide quoted text -
    >
    > - Show quoted text -


    What version of VWD do you use, a Visual Web Developer Express?

    Look at this thread:
    http://groups.google.com/group/micr...read/thread/2e6a3bd61105a335/133e9abca510a365

    Visual Web Developer (General Info)
    http://msdn2.microsoft.com/en-us/library/ms178093(VS.80).aspx
    Alexey Smirnov, Apr 4, 2007
    #8
  9. Pao

    Pao Guest

    On Apr 4, 12:14 pm, "Alexey Smirnov" <> wrote:
    > On Apr 4, 11:50 am, "Pao" <> wrote:
    >
    >
    >
    >
    >
    > > On Apr 4, 11:30 am, "Alexey Smirnov" <> wrote:

    >
    > > > On Apr 4, 11:17 am, "Pao" <> wrote:

    >
    > > > > On Apr 4, 11:05 am, "Pao" <> wrote:

    >
    > > > > > > Is your virtual directory configured as an application in IIS or not?
    > > > > > > If yes, I would check an Application Settings in IIS (virt.directory -
    > > > > > > properties) and ASP.NET tab. Do you have all files in the right place
    > > > > > > (/BIN, web.config)?- Hide quoted text -

    >
    > > > > > Yes, the virtual directory is configured as application in IIS.
    > > > > > But in the directory there isn't any BIN directory or web.config file.

    >
    > > > > > When I create a virtual directory as an application in IIS, and then I
    > > > > > open it with Visual Web Developer, I see a message saying that the
    > > > > > directory is not configured to work with asp.net, and Vis Web Dev ask
    > > > > > if I want to configure it now.
    > > > > > I answer Yes and I wait for a while, but no BIN directory and
    > > > > > web.config files are created, and if I run a page (show in browser) I
    > > > > > get the error.

    >
    > > > > I also tried to copy the content of a directory that works well to my
    > > > > new directory.
    > > > > I open IIS and all settings seem good
    > > > > (- asp.net enabled version 2.0.50727
    > > > > - virtual directory correct
    > > > > - file location corresponding to the correct web.config file)
    > > > > I try to open it with IE but I get the same error (initial character
    > > > > not valid)

    >
    > > > <%@ Page ... CodeFile="Default.aspx.cs" Inherits="_Default" %>

    >
    > > > The code above means that you use a code-behind. When you deploy your
    > > > application, you are required to deploy the assembly DLL to the Bin
    > > > folder. If you use global.asax and web.config, you are required to
    > > > deploy these files too.- Hide quoted text -

    >
    > > > - Show quoted text -

    >
    > > Already tried, copying all the content of the working web site on the
    > > new web site, including web.config and BIN folder. Nothing to do.
    > > Thank you for the link about creating a web application with visual
    > > web developer; I tried it and it seems to work fine; but if I look
    > > better,
    > > no web.config neither BIN directory are created, and if I click the
    > > "view in browser button" I get the same error.- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > What version of VWD do you use, a Visual Web Developer Express?
    >
    > Look at this thread:http://groups.google.com/group/microsoft.public.dotnet.framework.aspn...
    >
    > Visual Web Developer (General Info)http://msdn2.microsoft.com/en-us/library/ms178093(VS.80).aspx- Hide quoted text -
    >
    > - Show quoted text -


    Thank you Alexey
    Yes, I use the express edition.
    I followed the links and tried to compile the website with
    aspnet_compiler.
    I tried both with and without the -u option; the website compiles with
    no error; however I try to run with IE and get the same error.
    At this point I think the framework is ok, as it compiles fine; and I
    think the error is due to IIS that can't configure the new virtual
    directories as aspnet applications.
    Pao, Apr 4, 2007
    #9
  10. Pao

    Pao Guest

    I saw in:

    properties of the virtual directory in IIS --> virtual directory -->
    configuration --> mappings

    I don't have all the mappings that the websites that work have; I see
    only 9 mappings and is missing also .aspx extension.

    So when I create a virtual directory IIS doesn't insert all the
    mappings I need. How can I correct this behaviour if I have already
    launched aspnet_regiis -i with no result?
    Pao, Apr 4, 2007
    #10
  11. re:
    > How can I correct this behaviour if I have already launched aspnet_regiis -i with no result?


    Just running aspnet_regiis -i won't reset all the stuff that needs resetting.

    We discussed this some time ago, and the problem was fixed.

    1. Make sure the file encoding in web.config is set to UTF-8.

    <globalization
    requestEncoding="UTF-8"
    responseEncoding="UTF-8"
    fileEncoding="UTF-8"
    />

    2. More importantly, run from whichever installation directory for .Net Framework version you're
    using

    {
    Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
    or
    Drive:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
    }

    aspnet_regiis -u and then, immediately after that, run aspnet_regiis -i

    If you're using IIS 6.0 ( Windows 2003 Server ), you'll also need to run aspnet_regiis -enable

    After that, open a cmd window from the "run" menu in the Start button, and run "iisreset".

    When you unregister and reregister the .Net Framework (you don't need to physically remove
    anything),
    the ASP.NET account gets reset and all the mappings are installed correctly.

    Just running aspnet_regiis -i doesn't reset the ASP.NET account nor the mappings.

    Let us know if that works.




    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/
    ===================================
    "Pao" <> wrote in message
    news:...
    >I saw in:
    >
    > properties of the virtual directory in IIS --> virtual directory -->
    > configuration --> mappings
    >
    > I don't have all the mappings that the websites that work have; I see
    > only 9 mappings and is missing also .aspx extension.
    >
    > So when I create a virtual directory IIS doesn't insert all the
    > mappings I need. How can I correct this behaviour if I have already
    > launched aspnet_regiis -i with no result?
    >
    Juan T. Llibre, Apr 4, 2007
    #11
  12. Pao

    Pao Guest

    On Apr 4, 4:48 pm, "Juan T. Llibre" <> wrote:
    > re:
    >
    > > How can I correct this behaviour if I have already launched aspnet_regiis -i with no result?

    >
    > Just running aspnet_regiis -i won't reset all the stuff that needs resetting.
    >
    > We discussed this some time ago, and the problem was fixed.
    >
    > 1. Make sure the file encoding in web.config is set to UTF-8.
    >
    > <globalization
    > requestEncoding="UTF-8"
    > responseEncoding="UTF-8"
    > fileEncoding="UTF-8"
    > />
    >
    > 2. More importantly, run from whichever installation directory for .Net Framework version you're
    > using
    >
    > {
    > Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
    > or
    > Drive:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
    >
    > }
    >
    > aspnet_regiis -u and then, immediately after that, run aspnet_regiis -i
    >
    > If you're using IIS 6.0 ( Windows 2003 Server ), you'll also need to run aspnet_regiis -enable
    >
    > After that, open a cmd window from the "run" menu in the Start button, and run "iisreset".
    >
    > When you unregister and reregister the .Net Framework (you don't need to physically remove
    > anything),
    > the ASP.NET account gets reset and all the mappings are installed correctly.
    >
    > Just running aspnet_regiis -i doesn't reset the ASP.NET account nor the mappings.
    >
    > Let us know if that works.
    >
    > 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/
    > ==================================="Pao" <> wrote in message
    >
    > news:...
    >
    >
    >
    > >I saw in:

    >
    > > properties of the virtual directory in IIS --> virtual directory -->
    > > configuration --> mappings

    >
    > > I don't have all the mappings that the websites that work have; I see
    > > only 9 mappings and is missing also .aspx extension.

    >
    > > So when I create a virtual directory IIS doesn't insert all the
    > > mappings I need. How can I correct this behaviour if I have already
    > > launched aspnet_regiis -i with no result?- Hide quoted text -

    >
    > - Show quoted text -


    Thank you very much now it works, I followed line by line what you
    wrote and, after the iis reset, all the mappings are restored (both in
    the default eb site and in the virtual directories)
    Pao, Apr 4, 2007
    #12
  13. re:
    !> Thank you very much now it works, I followed line by line what you
    !> wrote and, after the iis reset, all the mappings are restored (both in
    !> the default web site and in the virtual directories)

    Great news! Glad to know you're up and running again!




    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/
    ===================================
    "Pao" <> wrote in message
    news:...
    On Apr 4, 4:48 pm, "Juan T. Llibre" <> wrote:
    > re:


    > > How can I correct this behaviour if I have already launched aspnet_regiis -i with no result?

    >
    > Just running aspnet_regiis -i won't reset all the stuff that needs resetting.
    >
    > We discussed this some time ago, and the problem was fixed.
    >
    > 1. Make sure the file encoding in web.config is set to UTF-8.
    >
    > <globalization
    > requestEncoding="UTF-8"
    > responseEncoding="UTF-8"
    > fileEncoding="UTF-8"
    > />
    >
    > 2. More importantly, run from whichever installation directory for .Net Framework version you're
    > using
    >
    > {
    > Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
    > or
    > Drive:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
    >
    > }
    >
    > aspnet_regiis -u and then, immediately after that, run aspnet_regiis -i
    >
    > If you're using IIS 6.0 ( Windows 2003 Server ), you'll also need to run aspnet_regiis -enable
    >
    > After that, open a cmd window from the "run" menu in the Start button, and run "iisreset".
    >
    > When you unregister and reregister the .Net Framework (you don't need to physically remove
    > anything),
    > the ASP.NET account gets reset and all the mappings are installed correctly.
    >
    > Just running aspnet_regiis -i doesn't reset the ASP.NET account nor the mappings.
    >
    > Let us know if that works.
    >
    > 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/
    > ==================================="Pao" <> wrote in message
    >
    > news:...
    >
    >
    >
    > >I saw in:

    >
    > > properties of the virtual directory in IIS --> virtual directory -->
    > > configuration --> mappings

    >
    > > I don't have all the mappings that the websites that work have; I see
    > > only 9 mappings and is missing also .aspx extension.

    >
    > > So when I create a virtual directory IIS doesn't insert all the
    > > mappings I need. How can I correct this behaviour if I have already
    > > launched aspnet_regiis -i with no result?- Hide quoted text -

    >
    > - Show quoted text -


    Thank you very much now it works, I followed line by line what you
    wrote and, after the iis reset, all the mappings are restored (both in
    the default eb site and in the virtual directories)
    Juan T. Llibre, Apr 4, 2007
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeffry van de Vuurst
    Replies:
    2
    Views:
    512
    Jeffry van de Vuurst
    Jul 30, 2003
  2. Kerri
    Replies:
    2
    Views:
    12,993
    Kevin Spencer
    Oct 27, 2003
  3. =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=

    Multiple bin-directories with virtual directories?

    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=, Nov 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    812
    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=
    Nov 9, 2004
  4. Replies:
    15
    Views:
    7,482
    Roedy Green
    Sep 8, 2005
  5. Paul F
    Replies:
    4
    Views:
    620
    Mark Fitzpatrick
    Jun 25, 2008
Loading...

Share This Page