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 8397887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:53:52+00:00 2026-06-09T20:53:52+00:00

I was tried like so: using System; using System.Windows.Forms; using Microsoft.SqlServer.Management.Common; using Microsoft.SqlServer.Management.Trace; namespace

  • 0

I was tried like so:

using System;
using System.Windows.Forms;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Trace;

namespace SqlProfiller
{
    public partial class Form1 : Form
    {
        TraceServer reader = new TraceServer();
        SqlConnectionInfo connInfo = new SqlConnectionInfo();

        public Form1()
        {
            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            connInfo.ServerName = @".\SQLR2";
            connInfo.DatabaseName = "DB";
            connInfo.UserName = "sa";
            connInfo.Password = "123";

            reader.InitializeAsReader(connInfo, @"Standard.tdf");


            while (reader.Read())
            {
                Console.WriteLine("SPID  : " + reader["SPID"]);
                Console.WriteLine("Login : " + reader["SessionLoginName"]);
                Console.WriteLine("Object: " + reader["ObjectName"]);
                Console.WriteLine("Text  : " + reader["TextData"]);
                Console.WriteLine();

                textBox1.Text += "Event : " + reader["EventClass"] + Environment.NewLine;
                textBox1.Text += "SPID  : " + reader["SPID"] + Environment.NewLine;
                textBox1.Text += "Login : " + reader["SessionLoginName"] + Environment.NewLine;
                textBox1.Text += "Object: " + reader["ObjectName"] + Environment.NewLine;
                textBox1.Text += "Text  : " + reader["TextData"] + Environment.NewLine;
                textBox1.Text += "----------------------------------------------------------";
                textBox1.Text += Environment.NewLine;
                Application.DoEvents();
            }
        }
    }
}

Error:

Microsoft.SqlServer.Management.Trace.SqlTraceException: Failed to
initialize object as reader. —> System.IO.FileLoadException: Mixed
mode assembly is built against version ‘v2.0.50727’ of the runtime and
cannot be loaded in the 4.0 runtime without additional configuration
information.

Failed to initialize object as reader.

What does this mean?

Thanks in advance

  • 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-06-09T20:53:53+00:00Added an answer on June 9, 2026 at 8:53 pm

    What does this mean?

    System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

    It means that your process in running as a .NET 4 process and the assembly you are loading is .NET 2 compiled (Microsoft.SqlServer.Management).

    Either recompile your application to use .NET 2 or add a hint for .NET 4 in config to allow .NET 2 assemblies.

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

Sidebar

Related Questions

I am using a Microsoft Chart control (system.windows.forms.datavisualization.charting.chart) in a Windows forms application, vb.net
Using Microsoft's charting control, System.Windows.Forms.DataVisualization.Charting.Chart, I am trying to render a chart to vector
I'd like to fill a multi-column System.Windows.Forms.ListView with the items I've stored in a
I have problem with getting username form windows system. I tried using getlogin function
I'm currently using the charting within .NET using System.Windows.Forms.DataVisualization.Charting.Chart . Thus far it seems
Can I read an excel file without using any module? I tried like just
I'd like to increase number of concurrent shells in PowerShell V2.I tried using the
I'm looking to build a tree-like structure for my Java application. I've tried using
I have a c# Windows Forms application, using .NET 3.5. My machine environment is
I'm trying to use a System.Windows.Forms.DataGrid control in my Compact Framework 3.5 Window Mobile

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.