.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

Simple test not working

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :.NET Framework
Hi all,  I've created a dummy test that does absolutely nothing. When I try to run it I get the following message: Error TestMethod1 TestProject Unable to get type TestProject.UnitTest1, TestProject. Error: System.BadImageFormatException: Could not load file or assembly 'TestProject, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. ... I compiled with platform set to x64, ma machine is a 64 bits and visual studio is not apparently [is installed in C:\Program Files (x86)]. I don't know exactly what .Net is installed. Struggling to really find out how to check that. Any ideas, Thanx, --mike

View Complete Post

More Related Resource Links

very simple asp:RegularExpressionValidator for Email not working

My implementation is simple. I have a public static variable in a class called EmailHelper containing my regular expression as follows:namespace Base.Core.Utilities { public static class EmailHelper { public const string EMAIL_REGEX = @"^([a-zA-Z0-9]+([\.+_-][a-zA-Z0-9]+)*)@(([a-zA-Z0-9]+((\.|[-]{1,2})[a-zA-Z0-9]+)*)\.[a-zA-Z]{2,6})$"; } } I then have the following web controls on my page:<asp:Panel ID="pnlChangeEmail" runat="server" DefaultButton="btnChangeEmail"> <asp:Label ID="lblChangeEmail" AssociatedControlID="txtEmail" runat="server">New email:</asp:Label> <asp:TextBox ID="txtEmail" runat="server" CssClass="textfield"></asp:TextBox> <asp:LinkButton ID="btnChangeEmail" OnClick="Change_Email" runat="server" ValidationGroup="ChangeEmail" CssClass="btn"> <strong><asp:Literal runat="server" ID="litSubmit" Text='<%$ Resources: GlobalResource, SUBMIT %>' /></strong> </asp:LinkButton> <asp:RequiredFieldValidato

visual tree hit test not working

I have a sketch/designer type of program. The user can sketch shapes. These shapes are polygons in a user control. I have an edge and a vertex class which generate the point collection for my polygons and connect the vertices to outline the polygon. I am using a selection box in an adorner to selection those controls and move them around. When I release the mouse after drawing the selection box, I run a hit test by calling VisualTreeHelper.HitTest. I pass in new     GeometryHitTestParameters(new RectangleGeometry(rect)) where the rectangle is the selection box, and this chooses the appropriate shapes. The user can take the selected shapes and "join" them to unselected shapes. In this situation. The shapes still remain in separate user controls, but they now share the common edges and vertices. At this point, my selection stops working intermittently. When I try to debug my hit test, I never hit the break points in my HitTestFilterCallback, HitTestResultCallback, or in my overridden HitTestCore functions. Then if I drag an edge or vertex, the selection may or may not start working again. I am not even sure how to debug this type of problem anymore. I have checked the visual tree for the canvas holding my shape controls and everything seems right.   Please help.  

<%# eval> not working for a simple property

<form id="form1" runat="server"> <div> <table> <tr> <td>Name: <%#customer%> </td> </tr> </table> </div> </form>        Partial Class ScorePage Inherits System.Web.UI.Page Private _customer As String = "Sachin" Public Property customer() As String Get Return _customer End Get Set(ByVal value As String) _customer = value End Set End Property End Class   The expected result in html page is Name: Sachin But i am getting Name: property is not getting displayed. I thought instead of creating a label control, we can use this method, but it is not working  

ssrs moved rdl files from dev server to test server but its not working


Hi All,

I have developed 5 reports in dev box.After testing those i have saved the rdl files in a shared loacation.I told the Test team guys to copy the rdl files from that shared loacation and perform testing those reports on test box.But they are not able to do it.The reports are not running.they are throwing errors.I have one shared datasource for all those 5 reports.The reportserver for dev box is sqldev05 and test box is sqltest05.

What are all the steps needed to be implemented by test team so that reports will run succesfully in test box.

Thanks in Advance!!


Test-SPContentDatabase isn't working


I have an SPS2010 beta farm up and running.  I wanted to use Test-SPContentDatabase against another non-related farm (but in the same domain, no firewalls in place) but every time I try to run Test-SPContentDatabase -Namedatabasename -WebApplication Url -ServerInstance RemoteSqlServerName , I get "Cannot find an SPWebApplication object with Name, Id, or Url:Url ".

Thoughts on what I'm missing?  The user account running the command has sa/domain admin privs and PS is being run while elevated.


Simple insert to test with...

Is this the most efficient way to run this code?  Basically just want to insert 100000 records into a table incrementing as it goes.
set nocount on

declare @i int;
set @i = 0
while ( @i < 100000 )
  insert into DebtorIDTest ( DebtorID ) VALUES ( @i )
  set @i = @i + 1

The reason I ask is when running this on SQL Server 2000 it runs about 2 - 3 seconds faster than when I run it on 2008.  Just wondering if perhaps there is a "newer" way of doing this.  Just running it from the Mgmt Studio.

Thanks in advance!

Simple jQuery inside a ListView ItemTemplate: Only 1st row is working?


Here is my js code:

$(document).ready(function () {

    $("#lnkBlocks").text("Show Blocks");

    //Show course blocks
    $("#lnkBlocks").click(function () {
        if ($("#divBlocks:first").is(":hidden")) {
            $("#lnkBlocks").text("Hide Blocks");
        } else {
            $("#lnkBlocks").text("Show Blocks");


Here is my ListView Item Template:

            <a id="lnkBlocks">Show Blocks</a>
            <asp:Label ID="ShortNameLabel" runat="server" Text='<%# Eval("ShortName") %>' />
            <div id="divBlocks" style="display:none;">This is the blocks box</div>


What is happening here and how do I fix it? I will also be enclosing the ListView inside an UpdatePanel later, after I get this fixed. Thanks.

window.location='test.aspx' not working on mobile website


Hello frds,

I'm having one problem in mobile website using jquery.

i have written a code on button click to redirect using window.location='test.aspx' it doesn't work event my javascript validation is also not worked. how to explain if your in other country give error 406 forbidden access is deny.



Test Run: Super-Simple Mutation Testing


Mutation testing is known for being difficult and expensive, but we're here to show you a real-world system you can build in just a few hours with a little C# code and Visual Studio.

James McCaffrey

MSDN Magazine May 2011

Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

A Simple and Extensible Radio Button Style GridView

The GridView is one of the significant controls in ASP.NET 2.0 and later versions. No doubt it reduces a lot of work time. However, customizing the GridView control is not an easy task. For example, it's hard to add a radio button column to the GridView. This article demonstrates the reason why a radio button column cannot act as normal and how to create a simple and extensible radio button GridView.

Silverlight Simple Animation

Silverlight has several built in techniques for animating controls. Many of these technologies are particularly useful for creating simple animations meant to decorate a web page with eye catching movement that draws the reader's attention. In this post I will skip over these decorative technologies, and instead show how to create a simple animation using a technique similar to those used in many games.

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

Test your skill in SQL Server

You will be given a series of 10 SQL Server related questions that are randomly selected. Since the questions are randomly selected, you will receive a different set of questions each time you start a test. At the end of the last question, you will be given your score. You can then start a new test session if you like.

Server side validation of Fileupload control not working



I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.

Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

I thought this would be simple... Trying to create a login does an ajax check before submit


I have the standard .net login control that is working.  (Still learning .net after 15yrs of classic)

What I want to do is OnButtonClick run a javascript function (to do an ajax call to the db to check if login is valid or not) and if it returns true, then submit the form normally, else don't submit. The piece that I can't figure out, is how to correctly override the default click even to hit my JS routine and then submit the form properly afterwards.

Thanks ahead of time

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