Solved

Exception thrown when creating an instance of a web service

Posted on 2008-06-22
5
404 Views
Last Modified: 2008-06-23
Hi,

I have a peculiar problem. When running my Windows Forms application (C# 2.0) from within VS2005, any call to my Web Service works as it should.
However, when running my compiled .exe, an exception is thrown (see below). The .exe file is built using NAnt.. so my first guess would be that I'm perhaps missing some dll.. but I can't seem to find a solution.

Any help is highly appretiated.
Exception:    vid System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)

   vid System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)

   vid System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)

   vid System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)

   vid System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)

   vid System.Web.Services.Protocols.SoapClientType..ctor(Type type)

   vid System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()

   vid ShrinkMyPhoto.Service.se.diod.services.MailService..ctor()

   vid ShrinkMyPhoto.Service.ChooseImageSizeService.SendEmail(String user, String email, String regkey, List`1 images, String mailfrom, String mailto, String mailsubject, String mailbody)

Open in new window

0
Comment
Question by:oxyoo
  • 3
  • 2
5 Comments
 
LVL 10

Author Comment

by:oxyoo
ID: 21842312
The exception is thrown when I try and create an instance of the web service.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 21844878
1) I haven't seen that exception, but there doesn't appear to be any real exception message with the stack trace.

2) Is ShrinkMyPhoto.Service.ChooseImageSizeService your web service?

3) What is happening in the SendEmail method?
0
 
LVL 10

Author Comment

by:oxyoo
ID: 21845213
2) ShrinkMyPhoto.Service is a class library. ChooseImageSizeService is an ordinary class.

3) Within the SendEmail method, what I do is that I create an object of my Web Service
do some image serialization and then call my web service method.

The thing is that when I'm debugging, it won't get pass my first line of code which is:
MailService mailService = new MailService();

Now, MailService is my Web Service, which means that I can't event create an instance
of it.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 21845335
Can you answer #1 better, and give the full exception message, and not the stack trace?
0
 
LVL 10

Author Comment

by:oxyoo
ID: 21845431
Sorry about that. I'm feeling a bit dense here, thought I'd outputed the exception message but apparently I had not.
I fixed that and now it's telling me a dll file missing, Should be ok now as soon as I add a reference to it.

Thanks for your time.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now