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

P

Pao

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...
 
A

Alexey Smirnov

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)?
 
P

Pao

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.
 
P

Pao

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)
 
A

Alexey Smirnov

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
 
A

Alexey Smirnov

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.
 
P

Pao

<%@ 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.
 
A

Alexey Smirnov

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
 
P

Pao

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.
 
P

Pao

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?
 
J

Juan T. Llibre

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/
===================================
 
P

Pao

re:


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/








- 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)
 
J

Juan T. Llibre

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/
===================================
re:

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/








- 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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top