天道酬勤,学无止境

.net

Removing Unit Test dll files when using WIX

I'm trying to create an MSI for my project using WIX. I've got HEAT pointing to the correct directory and the file it spits out is correct, but for some reason when I actually run MSBuild on it it's also giving me all of my unit test dll files. Anyone have any idea how to remove those from the build process?

2022-01-19 02:39:10    分类:问答    .net   msbuild   wix   windows-installer

Does MultiColumnText Work in iTextSharp v5.3.3?

I can't find MultiColumnText anywhere in iTextSharp v5.3.3 (from NuGet). All I can find is ColumnText which certainly isn't as friendly to use and is more than I really need. Am I missing something? There are several links that say that MultiColumnText should exist. http://api.itextpdf.com/itext/com/itextpdf/text/pdf/MultiColumnText.html itextsharp nextcolumn not working http://www.mikesdotnetting.com/Article/89/iTextSharp-Page-Layout-with-Columns http://www.devshed.com/c/a/Java/Adding-Columns-With-iTextSharp/

2022-01-19 02:34:56    分类:问答    .net   itextsharp

How do completely disable signed assemblies?

I have a VS.NET 2010 solution with several projects. I just added a new library project (the.library.assembly). The startup project is a website. When I run the website, I get this error: Could not load file or assembly 'the.library.assembly' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) Where does this come from? I haven't been using signed assemblies with other projects and they work fine. --- EDIT --- Actually, I

2022-01-19 02:19:54    分类:问答    c#   asp.net   .net   visual-studio-2010

GetCharIndexFromPosition() for the last char

I want to get the sub-string under cursor in a RichTextBox. private void richTextBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Clicks == 1 && e.Button == MouseButtons.Left) { string wholeText = richTextBox1.Text; // Obtain the character index where the user clicks on the control. int positionBegin = richTextBox1.GetCharIndexFromPosition(new Point(e.X, e.Y)); SelectedText = wholeText.Substring(positionBegin); } For example, if I type the string World then place the cursor between l and d, the sub-string should be d. Till now my code is working, however if I place the cursor at the end

2022-01-19 01:53:23    分类:问答    c#   .net   winforms

Getting the path of a nuget package programmatically

I'm installing a nuget package with an executable in it. To reference the executable from within the solution in a project file (more specifically in an mvc controller), at the moment I need to hardcode the folder path, which is particularly annyoing since it has a version number in it. So when I update the nuget package, I'd need to change all these references. That seems silly I'm still fairly new to the microsoft stack, but isn't there some way to just request the path of a nuget dependency?

2022-01-19 01:50:21    分类:问答    c#   .net   nuget

Creating PKCS1 public key in Net Framework

I need to create an RSA 1024 bit "PKCS1 public key without PEM headers" and store it as an array of bytes. In Net. Framework I have 2 arrays: RSAParameters.Modulus and RSAParameters.Exponent (which constitue a public key as I understand). How can I convert these two arrays into a "PKCS1 public key without PEM headers"? Thank you.

2022-01-19 01:44:34    分类:问答    c#   .net   cryptography   rsa   pkcs#1

Avoid serializing certain properties in REST services

I have a .Net application split in client and server sides, and the server provides REST services (using WCF). I have services definitions like these: [WebGet(UriTemplate = "/Customers/{id}")] Customer GetCustomerById(string id); [WebGet(UriTemplate = "/Customers")] List<Customer> GetAllCustomers(); The Customer class and its friends are mapped to a database using Fluent NHibernate, with Lazy Loading. If I return from the service outside the Session-scope the service call will fail as it can't serialize the referenced lazy loaded Orders property (see class def at the end). The problem is that

2022-01-19 01:41:54    分类:问答    .net   wcf   nhibernate   rest   serialization

Months difference between dates [duplicate]

This question already has answers here: Closed 10 years ago. Possible Duplicate: Difference in months Hi all: how can We calculate the months difference between two dates using LINQ ? I can find days difference using: (p.Account.StateChangeDate.Date - DateTime.Now.Date).Days < 4 but there is no option for months. Please suggest.

2022-01-19 01:32:16    分类:问答    .net

The remote procedure call failed Excel inside IIS

When I try to download an Excel file using asp.net I get this Error The remote procedure call failed. (Exception from HRESULT: 0x800706BE) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The remote procedure call failed. (Exception from HRESULT: 0x800706BE) Source Error: xlworkbook.SaveAs(Path) xlworkbook.Close() xlAPP.Quit() 'error on this line [COMException (0x800706be): The remote

2022-01-19 01:30:08    分类:问答    asp.net   .net   vb.net   excel   iis

Problem with ASP.NET Custom Validator for a Comma Separated List of Email Addresses

I followed a blog post here to use a custom validator to validate a list of emails. However, the Regex expression in the article: Regex emailRegEx = new Regex(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", RegexOptions.IgnoreCase); allows this email address through: "APL@domain.com 123@domain.com" which is clearly invalid. How can I change it to flag this as invalid? Note: When you use the core RegEx Validator with the SAME regex expression it DOES catch that email, so perhaps it is a problem with the matching options? Thanks

2022-01-19 01:10:56    分类:问答    c#   .net   regex   validation