VS2008 and Webservice

B

bob

Hi,
I am trying to develop a webservice and an aspx client on a Win2003
server box. The IDE is VS2008.
The thing just seems totally flaky.
Webservice compiles and publishes with no errors.
Access the Service with http://localhost:2092/EasyVend0r.asmx (Note
using the port assigned by the IDE)
and no problem.

But start a browser and go to access the ASMX with the published URL
of http:localhost//EasyVend0r.asmx and you get
Parser Error Message: Could not create type 'EasyVend0r.EasyVend0r'.

Source Error:

Line 1: <%@ WebService Language="C#" CodeBehind="EasyVend0r.asmx.cs"
Class="EasyVend0r.EasyVend0r" %>

Getting similar errors when trying to access the aspx client page.

Basically as long as you stay in the IDE or use the port that the IDE
has assigned you can view the asmx and aspx
Go outside and the wheels fall off.

I am not a web developer so I am probably missing some fundamental
step.

But it is annoying that everything seems to deploy OK according to the
IDE but the browser is unhappy with the 'published' i.e. Unspecified
port result.
I don't remember grief like this with VS2005
Any clues as to what I am doing wrong?

Thanks
Bob
 
H

henk holterman

bob said:
Webservice compiles and publishes with no errors.
Access the Service with http://localhost:2092/EasyVend0r.asmx (Note
using the port assigned by the IDE)
and no problem.

But start a browser and go to access the ASMX with the published URL
of http:localhost//EasyVend0r.asmx and you get
Parser Error Message: Could not create type 'EasyVend0r.EasyVend0r'.
[...]
Line 1: <%@ WebService Language="C#" CodeBehind="EasyVend0r.asmx.cs"
Class="EasyVend0r.EasyVend0r" %>

Bob, when you run from the IDE you are using the built-in webserver
(Cassini), on a selected port.

When you use /localhost/ , without a port, you must be using a virtual
directory on the installed server (IE) on your PC.

Apparently you did not correctly publish the entire webservice to this
virtual directory. Try using the Publish_Website option from the IDE.

It also looks like you are using the root virtual dir, that may not be
wise. Be aware that the Publish tool will "clean" it's target folder.

-HH-
 
H

henk holterman

bob said:
Webservice compiles and publishes with no errors.
Access the Service with http://localhost:2092/EasyVend0r.asmx (Note
using the port assigned by the IDE)
and no problem.

But start a browser and go to access the ASMX with the published URL
of http:localhost//EasyVend0r.asmx and you get
Parser Error Message: Could not create type 'EasyVend0r.EasyVend0r'.


Bob, when you run from the IDE you are using the built-in webserver
(Cassini), on a selected port.

When you use /localhost/ , without a port, you must be using a virtual
directory on the installed server (IIS) on your PC.

Apparently you did not correctly publish the entire webservice to this
virtual directory. Try using the Publish_Website option from the IDE.

It also looks like you are using the root virtual dir, that may not be
wise. Be aware that the Publish tool will "clean" it's target folder.

-HH-
 
M

Marc Gravell

Have you configured the target directory (in IIS or whatever) to run
as an application? You need to do this manually, otherwise the "app"
will be at the wrong folder, and the "bin" folder won't be used, so
your types don't exist.

This is usually the problem with this error message...
 
B

bob

Hi Henk and Marc
Thank you for your replies.
I now know where to look.

It seems to me we still have a way to go with Web deployment.
Ironic given that the Dot net movement started with the Web in mind.

When a dumb bunny like me pushes a publish button and gets led
through a wizard that completes successfully, they are entitled to
expect that no specialised additional knowledge is required to
'really' publish.

regards
Bob
 
M

Marc Gravell

Ironic given that the Dot net movement started with the Web in mind.

Well, it (a better ASP via ASP.NET) was certainly a consideration -
but it was far from the only aim... another goal was to be a better
COM/COM+, regardless of *what* it was doing...

Note that "web deployment projects" almost certainly configure IIS
like this.
 
M

Marc Gravell

When a dumb bunny like me

lol - don't put yourself down, though: you "had a go", had problems,
tried a few things, found a suitable* forum, gave relevant details of
the setup and the error... sounds pretty smart to me ;-p

I hope you get it fixed - if not, post back with any additional
details...

[*=ok, the asp forums might have been better, but close enough]
 
B

bob

Well, it (a better ASP via ASP.NET) was certainly a consideration -
but it was far from the only aim... another goal was to be a better
COM/COM+, regardless of *what* it was doing...

Note that "web deployment projects" almost certainly configure IIS
like this.

Ahhhh Web deployment project. Now there's a thought. (Didn't even know
there was such a beast.) I really must get out more. :)

May be my best option is to stay inside the IDE and leave outside
testing to deploying on another box. (Don't want to deploy anything on
my box, last time I de-installed an app I had deployed, it totalled
the IDE.)

Can you please elaborate on setting the directory as an application
directory.
I have been wandering around checking properties etc inside and
outside of IIS Manager

I think my problems are more deep seated though. Again possibly
related to not deploying properly.
The application log is filling up with errors known to the knowledge
base.
I am running my IDE on a Win2003 server. I have been through a couple
of the KB articles (315158, 811320.) which essentially indicate that
the ASPNET account doesn't have enough rights to access the working
and or system directories.

I have implemented the 'fixes' but still no go.

On a more general note I think you have answered my philisophical
critiicisms. The presence of a Web deployment project puts Web
development on the same footing as Application development. i.e
Deployment is specifically focussed on and catered for.

My lack of experience with web development had me thinking that
publishing was all there was.


Thanks for your time on this problem.
regards
Bob
 
M

Marc Gravell

Load the IIS snap-in for MMC (aka IIS Manager).

In IIS, find the folder where you deployed your app.
Right-click, Properties.
On the "Directory" or "Virtual Directory" tab (depending on whether it
is a logical or physical node in the tree), there should be an
"Application settings" section; look at the "Application name" - if it
is grey and disabled, it isn't an application - hit "Create". Now go
onto the ASP.NET tab and ensure it is running the right ASP.NET version
(probably 2.0.{blah}).

Exit the dialog - your folder should now have a shiny cog icon,
indicating that it is an application. It should also now appear in the
"Application Pools" tree.

Marc
 
M

Marc Gravell

Re the identity issues, I could *probably* help, but you might want to
repost to an ASP.NET-specific group for a better answer.

Re "publish", I only really use that in the IDE to move things between
development boxes...

As for *using* web-deployment projects - I must admit that I know of
their existance, and have played with them, but I've never really used
them in anger. We tend to use a manual one-time task of setting up IIS,
and then we just use "robocopy /E /MIR" to deploy to the (multiple) web
servers (as part of a proper process - not simply from a developer
desktop ;-p).

Marc
 
B

bob

Hi Marc,
I guess it is a case of really seeing what your looking at.
They were already cogs
And once I looked at the TABS properly the intention of the dialog box
is quite clear.
So...
It is broke it a meaningful way.
But it has had its two minutes in the sun.
The focus has been directed to another project.
I won't pursue this anymore until the current crisis is over.
thanks again
Bob
 
B

bob

Hi Marc,
This was going to be just an extra convenience for an IVR vending
system. As per my other post it has been postponed.

I'll look at getting it working in the IDE only and then we may farm
the deployment out to someone who knows what they are doing.
There is also the whole web security aspect about which we know
nothing.
regards
Bob
 

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