Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6642009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:52:45+00:00 2026-05-25T23:52:45+00:00

// stuff…… return SendCreationMail(Membership.GetUser((Guid)request.UserEntityId), request, new Control()); } private const string TemplateRoot = ~/app_shared/templates/mail/;

  • 0
    // stuff......

    return SendCreationMail(Membership.GetUser((Guid)request.UserEntityId), request, new Control());
}

private const string TemplateRoot = "~/app_shared/templates/mail/";
private const string ServerRoot = TemplateRoot + "server/";

public static bool SendCreationMail(MembershipUser user, IServerAccountRequest request, Control owner)
{
    var definition = new MailDefinition { BodyFileName = string.Concat(ServerRoot, "creation.htm"), IsBodyHtml = true };
    var subject = "New {0} account created!".FormatWith(request.ServerApplicationContract.Id);

    var data = ExtendedData(DefaultData, subject, user);

    data.Add("<%ServerApplication%>", request.ServerApplicationContract.Id);
    data.Add("<%ServerApplicationName%>", request.ServerApplicationContract.ApplicationName);
    data.Add("<%AccountUsername%>", request.AccountUsername);

    data.Add("<%ServerInfo%>", "/server/{0}/info".FormatWith(request.ServerApplicationContract.Id.ToLower()));

    return definition.CreateMailMessage(user.Email, data, owner).Send(subject, ApplicationConfiguration.MailSenderDisplayName);
}

I get:

Value cannot be null. Parameter name: basepath

at System.Web.Util.UrlPath.Combine(String appPath, String basepath,
String relative)
at
System.Web.UI.WebControls.MailDefinition.CreateMailMessage(String
recipients, IDictionary replacements, Control owner)
at
Damnation.Website.Main.Common.MailTemplating.Server.SendCreationMail(MembershipUser
user, IServerAccountRequest request, Control owner)
at Damnation.Website.Main.Common.MailTemplating.Server.SendCreationMail(IServerAccountRequest
request)
at Damnation.Website.Main.Business.Model.ServerAccountRequest.UpdateRequestsAfterServerProcessing(IEnumerable`1
results)

Thing is I don’t have an actual Control to pass to it, I’d like to know how to setup a control that avoids this senseless exception. I’m using a relative path… so this makes no sense.

The application that has the service is under ASP.NET WebForms .NET 4. The consumer application is a console application also under .NET 4

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:52:45+00:00Added an answer on May 25, 2026 at 11:52 pm

    I had the same problem, and I learned that this is happening because it cannot find the path of the control when trying to execute your definition.CreateMailMessage. You want to create a blank web user control. Maybe this is not the most elegant solution but it does the work.

    This is what I did:

    1) Add a Web User Control file in your project, for example Test.ascx.

    2) In your .svc file add the following code:

    Page page = new Page();
    
    Test test = (Test)page.LoadControl("Test.ascx");
    

    3) Update your definition.CreateMailMessage line to:

    return definition.CreateMailMessage(user.Email, data, test).Send(subject, ApplicationConfiguration.MailSenderDisplayName);
    

    You will no longer get the basepath null exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

private void activateRecords(long[] stuff) { ... api.activateRecords(Arrays.asList(specIdsToActivate)); } Shouldn't this call to Arrays.asList return
good stuff // ok to alias a List Type using AliasStringList = System.Collections.Generic.List<string>; //
var stuff = ctx.spReport(); var StuffAssembled = new List<ReportCLS>(); var val = new List<ReportCLS>();
Simple stuff here... if I try to reference a cookie in Django via request.COOKIE[key]
New to .NET/C# stuff so please forgive me if it's something obvious ;-) I'm
var Stuff = (function() { return { getId: function (id) { return document.getElementById(id); },
I new to xml stuff, so I have no idea which api I should
def getStuff(x): return 'stuff'+x def getData(x): return 'data'+x thefunctions = [] thefunctions.append(getStuff) thefunctions.append(getData) for
My stuff is made with several components among which some are written in C.
I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.