Solved

Exception thrown when creating an instance of a web service

Posted on 2008-06-22
5
411 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

803 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