.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cannot FindByThumbprint - Invalid Hexadecimal string format

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :WCF
I'm trying to set up a sample WCF service using a self-signed certificate.  For some reason, I repeatedly get the error "FormatException - Invalid hexadecimal string format." I was initially trying it in the config file but decided to try setting it up in code but still get the same error. I then tried it on a different machine and it works just fine.  I would appreciate any suggestions.  Here are the details. Environment:  Windows 7 Home Premium, Visual Studio 2010 C# Express Edition, .NET 4.0 Code:     // Create the host ServiceHost host = new ServiceHost(hostType);     string valueToFind = "‎‎‎‎‎66 31 bf 9e f7 4f 9e b6 c9 d5 a6 0c ba 6a be d1 f7 bd ef 7b"; host.Credentials.ServiceCertificate.SetCertificate(   StoreLocation.CurrentUser, StoreName.Root, X509FindType.FindByThumbprint, valueToFind);     The exact same code runs just fine on another machine.  No complaints of an invalid hexadecimal value.  Here are the details of the other machine: Environment:  Windows XP, Visual Studio 2010 C# Premium, .NET 4.0 Any ideas?

View Complete Post

More Related Resource Links

Input string was not in a correct format.


Hi, I just started learning asp.net

i set simple application but i get this error that  "Input string was not in a correct format"

Input string was not in a correct format.

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.FormatException: Input string was not in a correct format.

Source Error:

Line 10:     protected void Page_Load(object sender, EventArgs e)
Line 11:     {
Line 12:         decimal num1 = Decimal.Parse(txtNumber1.Text);
Line 13:         decimal num2 = Decimal.Parse(txtNumber2.Text);
Line 14:         decimal ans = num1 + num2;

How can I correct this error




While dispose the com+, encounter error: failed due to the following error: Old format or invalid ty

I have web service to invoke com+ to do business layer checking. recently, the application encountered intermittently the following error while tried to dispose the com+ instance. Appreciate anyone who help for this. thanks!   System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'System.IDisposable'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{805D7A98-D4AF-3F0F-967F-E5CF45312D2C}' failed due to the following error: Old format or invalid type library. (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT)).   Server stack trace:    at System.IDisposable.Dispose()    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)   Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage

XML Task error message hexadecimal invalid character

I am developing a SSIS package to add data from an XML file to an existing SQL Server table.  I have completed several similar projects, but on this XML file I am getting the error from the Data Flow tab between the XML Task and Data Flow Task: Error: 0xC002F304 at XML Task, XML Task: An error occurred with the following error message: "'', hexadecimal value 0x15, is an invalid character. Line 28, position 54.". Error: 0xC002928F at XML Task, XML Task: Property "New Source" has no source Xml text; Xml Text is either invalid, null or empty string. Task failed: XML Task Warning: 0x80019002 at zSTU_TS_Element: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "zStu_TS_Element.dtsx" finished: Failure. Do you know how I can fix this? This is the line it is referring to: <z:row c0='12' c1='80' c2='2006-04-17' c3='539' c4='1M2083N4N5N6N75800901110 11 '/>

XML Web Services: Invalid URI: The Uri string is too long.

error  Invalid URI: The Uri string is too long. (UriFormatException was unhandled by user code)

SlideShowExtender - Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.web

Hello,   I put a SliderShowExtender and i created a web service with a function that return AjaxControlToolkit.Slide(), but when a run the project give me the error: Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'returnLogo' failed with the following error: <html>    <head>        <title>Unknown web method 'returnLogo'.<br>Parameter name: methodName</title>        <style> ...   Anybody know why?   Tks

Input string was not in a correct format.

I am trying to convert a null value to a double value using convert function in C#. Can anybody help me in this regards... I am getting a null value in a variable named "gridCol1" Step 1 - I am doing                Convert.ToDouble ( gridCol1.ToString() );                Error : "Input string was not in a correct format."

XmlWriter.WriteRaw - hexadecimal value 0x1F, is an invalid character.

Using VS 2008, .Net 3.5, C#. In creating an XML string, I need to embed some non-printing ASCII characters such as 0x1C, 0x1D, 0x1E and 0x1F. However, when writing them using the WriteRaw function, I get the error message "hexadecimal value 0x1F, is an invalid character". In checking XML specifications, all the characters I am using are valid in XML. The xml declaration in the string is "<?xml version="1.0" encoding="utf-16"?>" Thanks in advance for any guidance.  

My problem with an gridView, Input string was not in a correct format.

Hello all ! I'am actually encounter problem with an gridView which is composed of five columns, the both first are string type, third is date and the two last are linkbutton to edit or delete rows. On clicking edit button, i catch good event to edit and traitment  work fine but on living function an error occur with this message : error : System.FormatException: Input string was not in a correct format. stackTrace :   [FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7471479 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 System.Web.UI.WebControls.GridView.GetRowIndex(GridViewRow row, String commandArgument) +99 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +602 System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +207 System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 System.Web.UI.Page.ProcessRequestMain(Boolean inclu

Usual solutions not the problem for Format of the initialization string does not conform to specific

I know that there are normally two causes/solutions for the "Format of the initialization string does not conform to specification starting at index 0" error message.  The two normal suggestions are a problem with the connection string or it is surrounded by quotes in Dimming the connection. I get the message while running in debug (though it is pulling the selected row ID value correctly).However neither of those are the case in my file.  I know the connection string is configured correctly because it works in the rest of the page.  Further I don't have quotes in the Dim connection part.  Relevant bits of code below.Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.ImageButton Imports System.Web.UI.WebControls.DataControlField Imports System.Data Imports System.Data.SqlClient Imports System.Configuration Imports System.Object Imports System.DirectoryServices Partial Class Default2 Inherits System.Web.UI.Page 'Private auth As authenticate 'Private dt As DataTable 'Private programs As DataRow() Private dbConnection As String = "KMConnectionString" . . . Sub btnPlay(ByVal sender As Object, ByVal e As EventArgs) 'grab video ID Dim videoID = GridView1.SelectedValue.ToString() Response.Write(videoID) Dim con As New SqlConnection(dbConnection)

Need to convert query string(date - 09/15/2010) to a text format - yyyymmdd

I am fairly new to C # and need some assistance with a form page.  I have created a simple form that requires the user to select a beginning date and ending date.  I then pass the values to my code behind page via query strings.  I have them passing, but I need the format to be change to a different format.  Unfortunately the database does not use the standard date format.  It requires the date to be in a text format as YYYYMMDD.Form: <tr> <td> Beginning Date:</td> <td><asp:TextBox runat="server" ID="begDate"></asp:TextBox> <asp:Image ID="Image2" ImageUrl="~/images/calendar_schedulehs.png" runat="server" /></td> </tr> Code Behind: protected void createReport_Click(object sender, EventArgs e) { StringBuilder url = new StringBuilder("Report/TopCustomer.aspx?"); url.Append("BegDate=" + begDate.Text); url.Append("&EndDate=" + endDate.Text); url.Append("&Brnch=" + ddlLocation.SelectedValue); Response.Redirect(url.ToString()); Current URL: TopCustomer.aspx?BegDate=09/15/2010&EndDate=09/30/2010&Brnch=300I need to have the above URL change to:TopCustomer.aspx?BegDate=20100915&E

MSG durring Installatioin:Input String was not in a correct format

I am in the process in installing SQL  Express 2008-R2. While running Setup, the following box pops up: SQL Server Steup faulure. SQL Server Setup has ecountered the following error: Input string was not in a correct format... Any ideas on how to correct this? Thanks in advance.  


Hi all,Here's some simple code<a href='<%= string.Format("../Print/Print1.aspx?withParameter={0}", Para )%>'>HyperLinkText</a>and it works well. so i guess i can write anything like this, so i wrote a test:<input type="button" value="Btn1" onclick='<%= string.Format("window.open('','_blank')") %>'/> <input type="button" value="Btn2" onclick="window.open('','_blank')"/>However, Btn1 does not work.. for some reason i have to NOT to use server control, so i wite it in inline-code style,why the first hyperlink work well, but Btn1 fails?could anyone tell me?thank you~

Database diagram failur - Invalid class string SSMS 2008

Hi There -  Help needed In SSMS 2008 (not express) the Database Diagram  cast the exeption "Invalid Class String" (MS Visual Database Tools). Why is this happening. I have used the diagram designer before succesfully My OS W7 - SqlServer 2008 - every thing updated  - every service pack installed I have tryed reinstall seceral times - not positiv What is going on - It had been working (1 month ago) Please help Freddy

Input string was not in a correct format.


DropDownList ddlCardDetails = LoginView2.FindControl("ddlCardDetails") as DropDownList;

        BurnbetDataContext ctx = new BurnbetDataContext("data source=.\\SQLEXPRESS;Integrated Security=SSPI;" +
                           "AttachDBFilename=|DataDirectory|\\BurnbetDatabase.mdf;User Instance=true");

            int Id = Convert.ToInt32(ddlCardDetails.SelectedValue.Split('|')[0]);
            tbl_Payment democustomer = ctx.tbl_Payments.SingleOrDefault(c => c.ID == Id);

        if (democustomer != null)




Input string was not in a correct format


I am trying to update a coulmn in datatable but keep getting error:

Input string was not in a correct format.Couldn't store <&nbsp;> in SortOrder Column.  Expected type is Int32.

SortOrder is column of Type Integer that either contain Null or number.

Any ideas? below is my code

   If e.CommandName = "Reset" Then
            Dim index As Integer = Integer.Parse(e.CommandArgument)
            dt = CType(Cache("dt"), DataTable)
            Dim value As Integer = 0
            value = Convert.ToInt32(dt.Rows(index)("ContentID").ToString())

            Dim SortOrderNum As Integer = 0
            SortOrderNum = dt.Rows(index)("SortOrder").ToString()
            dt.Rows(index)("SortOrder") = DBNull.Value   'dt.Rows(index - 1)("SortOrder")

            dtNew = dt.Copy()
            dgArticles.DataSource = dt
            Dim i As Integer = 0
            For i = 0 To dgArticles.Rows.Count - 1
                dtNew.Rows(i)("ContentID") = dgArticles.Rows(i).Cells(0).Text

                dtNew.Rows(i)("Headline") = dgArticles.Rows(i).Cells(1).Text

                dtNew.Rows(i)("SiteName") = dgArticles.Rows(i).Cells(2

datetime formating with string.format


I have a table in my SQL DB that is a DateTime table, what I want to do is take the numeric datetime it stores and convert it to a long date (i.e. 12/12/2012 conversts to December 12, 2012). Seaching the forums it looks like the string.format is the way to go and searching for info on that I found http://www.csharp-examples.net/string-format-datetime/ which lists all the different formats but they do not list a formating string to convert to the format I want to use. Does anyone know what format string I would use to convert a numeric date to a long date like I want? And can you show it in a code example because I am not 100% sure I understand the code examples shown on that site.

String[4]: the Size property has an invalid size of 0.


Hi, I am new to asp.net and I don't know what to do on this problem, can someone give me a hint/advice on how I can make my insert do the task, here is my stored procedure:

-- =============================================
-- Author: <Lau>
-- Create date: <092210>
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend