Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all 1710 articles
Browse latest View live

GAC Replication?

$
0
0

Simple question. Possibly not a simple answer, or maybe very simple... Is it possible to use replication on the Windows GAC?

At my company we are replicating our production environment to our staging environment but only our application folders are replicating. but if there is a new feature / change in one of the assemblies that we put into the GAC it doesn't carry over to staging and can cause issues. I've been trying to find an answer to this but am having trouble.


I need to find the difference between two tables.

$
0
0

Hi All,

I have a requirement in C# to develop Client and server application.

Client Side: I need to develop UI application using WPF

Server SIDE: I need to read the two tables from the database and  i need to find the difference between two tables.

For Example: Table1: 

MachineID

CurrentValue

TaskName

0001

2

000_Task1_123

0002

0.5

000_Task2_123

0003

0.0

000_Task3_345

0004

0.3

000_Task4_456

Table1:

MachineID

CurrentValue

TaskName

0001

5

000_Task1_323

0002

0.8

000_Task1_123

0003

0.0

000_Task8_45

0004

0.9

000_Task4_456

I need to find each column value differences. The result table should look as below:

MachineID

CurrentValue

TaskName

MachineID

CurrentValue

TaskName

0001

2

000_Task1_123

001

5

000_Task1_323

0002

0.5

000_Task2_123

002

0.8

000_Task2_123

0003

0.0

000_Task3_345

003

0.0

000_Task8_45

0004

0.3

000_Task4_456

004

0.9

000_Task4_456

Whichever column value is difference that value I need highlight with red colour.  Whichever column value has no difference I need to keep as it is.

This finding difference algorithm I need to do it in server side using C# and the result I need to display in UI on client side.

Can please someone can help in finding the differences and how do i send the data between server and client.

It would be great if someone can help in this requirement.

Thanks & Regards,

Lokesh

Faulting module name: clr.dll

$
0
0

We are using .Net Framework 4.0 and while running the console app the application is throwing below the error and exiting with error code80131506.

"Faulting module name: clr.dll"

After restarting the console app it is running fine. This kind of failure is occuring once in a week. Please suggest how to fix it.

Problem about DLL unloading

$
0
0

Hello,

I have a C++ dll which uses C#.net code by clr(Consider DLL A).

Now I'm using this dll into other C++ dll(Consider DLL B) by LoadLibrary function. After completing my work, I'm unloading this dll(DLL A) with FreeLibraby API and try to delete that loaded DLL(DLL A).

But I'm not able to delete this DLL(DLL A) as it is not unloaded from my Client DLL(DLL B). 

How can I unload this DLL(DLL A) and delete after using it.

Thanks in Advance.

CrossContext exception on native to managed boundary

$
0
0

I have developed a C++/CLI application which return an object of ManagedSubscription to C# clients.

ManagedSubscription receives a callback from C# clients, internally makes its own callback to communicate to native C++ code.
While crossing boundaries from native to managed, I observe a crash.
I have put try-catch in native as well as managed callbacks, but it is not caught.

This is my managed C++ code:

struct NativeCallbackWrapper
      {
      public:
        typedef std::function<bool(const std::vector<Sample>&, bool)> Callback_t;
        typedef bool(*CallbackPtr)(const std::vector<Sample>&, bool);

        NativeCallbackWrapper(Callback_t callback)
          : m_callback(callback)
        {
        }

        ~NativeCallbackWrapper()
        {
        }

        const Callback_t                                            m_callback;
      };


      //Here is decalred variables in ManagedSubscription.h file
      typedef std::function<bool(const std::vector<DFS::Chart::Misc::Sample>&, bool)> Callback_t;
      typedef bool(*CallbackPtr)(const std::vector<DFS::Chart::Misc::Sample>&, bool);
      delegate bool DelegateFunc(const std::vector<DFS::Chart::Misc::Sample>&, bool);

      NativeCallbackWrapper                        *m_nativeCallbackWrapper;
      System::Action<Response, bool>^         m_callback;
      DelegateFunc^                                m_delegate;
      System::Runtime::InteropServices::GCHandle   m_delegateHandle;


      //This object is returned to C# application
      ManagedSubscription::ManagedSubscription(
        Action<Response, bool>^ callback)
      {
        m_delegate = gcnew DelegateFunc(this, &ManagedSubscription::OnCallback);
        m_delegateHandle = System::Runtime::InteropServices::GCHandle::Alloc(m_delegate);
        m_nativeCallbackWrapper = new NativeCallbackWrapper(static_cast<CallbackPtr>(Marshal::GetFunctionPointerForDelegate(m_delegate).ToPointer()));
        m_callback = callback;
      }

bool ManagedSubscription::OnCallback(const std::vector<Sample>& result, bool disconnected)
  {
    try
    {
        m_callback(samplesData, disconnected);
        return true;
    }
    catch (Exception^ ex)
    {
      return false;
    }
    catch (Object^ ex)
    {
      return false;
    }
  }

  //This is given to natice class which actually calls this callback (ManagedSubscription::OnCallback mentioned above)
  const ManagedSubscription::Callback_t& ManagedSubscription::GetNativeCallback()
  {
    return m_nativeCallbackWrapper->m_callback;
  }

This is my native C++ code:

bool Publish(const std::vector<SampleType>& samples, bool disconnected)
        {
          try
          {
            //This actually calls managed callback (ManagedSubscription::OnCallback)
            return m_subscriptionCallback(samples, disconnected);
          }
          catch (std::exception& e)
          {
            return false;
          }
          catch (...)
          {
            return false;
          }
        }

This is stack trace of crash:

KERNELBASE!RaiseException+68     cdb52105     00007ffb     00000001
clr!RaiseTheExceptionInternalOnly+33b     cdee43f4     00007ffb     00000000
clr!RaiseTheException+a4     cdee4460     00007ffb     00000002
clr!RealCOMPlusThrow+69     cdeb6d72     00007ffb     43d60b70
clr!Thread::RaiseCrossContextException+333     cdcd24cb     00007ffb     2fbadcf8
clr!Thread::DoADCallBack+1a8     cdb69535     00007ffb     2fbade01
clr!UM2MDoADCallBack+b3     cdb681dd     00007ffb     8a988a50
clr!UMThunkStub+26d     bc090516     00007ffb     2fbaef70
ManagedChartFeedInterface!DFS::Chart::HistoricalCache::TypedSubscription<DFS::Chart::ChartCache::ForexInstrumentInfo>::Publish+66

First line of stack trace represents call from native code return m_subscriptionCallback(samples, disconnected); in Publish mentioned above.

Can someone suggest what could be possible reasons of this crash or in which direction I should look at?



How to Transfer data between Client and server using WCF using C#

$
0
0

I have a requirement like i need to transfer huge set of data (around 30-40 lakhs of records) from server to client using WCF in C#.

I will have multiple clients there is no limit in clients and i have only one server. So at a time multiple clients are accessing one server.

Can anyone please let me know the feasible solution to communicate between client and serve and a good multithreaded solution to access one server from multiple clients parallely.

Thanks & Regards

Lokesh


How to use the Profiling API to record the parameters and returned value?

Could not load file or assembly ***.dll or one of its dependencies

$
0
0

Hi,

I have a c#.net windows forms application project which uses a visual c++ (project) dll as a reference existing in the same solution.
The C++ dll is Camlib.dll.
In the configuration manager, C++ project is set to Win32 and c# project is set to x86.
The error "Could not load file or assembly CamLib.dll or one of it dependencies" is thrown only on few machines.
Currently this error is seen on a fresh Windows 10 64 bit machine.

This works fine in my Windows 7 64 bit development machine. There is one more thing what is observed. The same application setup is installed in 2 production laptops with same configuration Win 10 64 bit. In one system MS Office 2013 is installed and the other not. The system in which MS Office is installed, its working, and the other one its not.

I have tried building the C#.net project setting to Any CPU, but the issue persists.
I have also checked Microsoft Visual C++ Redistributable package. Both x86 and x64 versions are installed (Version 11).

(2008, 2010, 2013 versions are present)

I have also used Dependency walker to check for the error. The error what i see is
"GetProcAddress at MSCOREEI.dll [RegisterSimImpICLeanupCallback] returned null from MSCOREE.dll. The specified procedure could not be found". Multiple errors are present with the same MSCOREE.DLL

Is there any supported sdk gets installed while MS Office installation? Or is there any setup which needs to be installed in the production system?

What would be the solution to this? Please help...

Thank you.


Rise in garbage collection of Gen 0, 1 and 2 despite constant bytes in all heaps. Is this sign of memory leak?

$
0
0

I was trying to find memory leak in our software and in doing so I have found that, in Windows built in "Performance Monitor" report-

 1. Garbage collection of Gen 1 and Gen 2  rises exponentially while
    process is doing some work
 2. Garbage collection of Gen 1 & Gen 2 remains constant when process is idle
 3. Garbage collection of Gen 0 continues to increase as time passes by irrespective of process is doing some work or not
 4. Bytes in all heap shows that it is not increasing over time

Is this normal?

Performance Monitor Report


Vaibhav Gawali

Thrid party component license fails at runtime

$
0
0

At runtime when my application calls a form that uses the 3rd party component this error shows

Error Stack: at c.a(LicenseContext A_0, Type A_1)
   at c.b(LicenseContext A_0, Type A_1)
   at q.a(LicenseContext A_0, Type A_1, Object A_2, Boolean A_3)
   at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
   at c.a(Type A_0, Object A_1)
...

...

The component's assembly is .NET 2.0/3.5, and deployed in GAC C:\Windows\assembly

My application is plugin to executable program, i.e. it is a class library .NET 4.5.1.  My assembly that calls the third party component assembly is deployed to GAC C:\Windows\Microsoft.NET\assembly\GAC_32

The host executable program is .NET 3.5 32bit

The licenses.licx is an embedded resource of the assembly calling the third party component assembly.  I can see it in the compiled assembly using JustDeompile.

My first guess here is there is a security issue with the interaction of the two assemblies that use different .net versions.  Can anyone offer some insight and advice on how to fix this?


Windows CE 6.0

$
0
0

Hello Guys,

I dont know much about programming but hope you can help me in an easy way. I bought a Chinese radio which runs  the application for the Radio GPS and DVD on WINDOWS CE 6.0. I believe I made some change in the car radio factory setup that now every time the radio starts, it starts from the windows CE and not from the radio. Please, tell me how I can configure it again. I will appreciate very much your help.

Eduardo

Can call sites be identified from the perpective of a DynamicObject?

$
0
0
Hi, researching how to simulate protected-member access from an implementation of DynamicObject and wondered if it is possible to verify that the calling MethodBase context would rightfully have access to that member the case of a contained (non-single inheritance) scenario. Is this information only internal to the binder?

Compiler Time Symbols

$
0
0

Does anyone know where I can find a list of compiler time symbols that visual studio already uses, such as: DEBUG, NET_4_0, RELEASE....?

I am asking because I run this code and I am looking to expand it.

private static string DotNetVersion()
{
         string value = "Nothing";
#if NET_4_0
         value = "4.0";
#elif NET_4_5
         value = "4.5";
#elif NET_4_5_1
         value = "4.5.1";
#elif NET_4_6
         value = "4.6";
#elif NET_4_6_1
         value = "4.6.1";
#endif
         return value;
}


MSDN jbeen19

CLR20r3 System.NullReferenceException PPJr8

$
0
0

Dear all,

My PC suddenly cannot run the Penpower and the following details shown in the following:

Problem signature:
  Problem Event Name:    CLR20r3
  Problem Signature 01:    ppjr.exe
  Problem Signature 02:   14.3.11.1409 
  Problem Signature 03:    53312026
  Problem Signature 04:    PPJr8
  Problem Signature 05:    14.3.11.1409
  Problem Signature 06:    53312026
  Problem Signature 07:    22f
  Problem Signature 08:    0
  Problem Signature 09:    System.NullReferenceException
  OS Version:    6.1.7601.2.1.0.256.4
  Locale ID:    3076

問題事件名稱:CLR20r3
  問題簽章 01:ppjr.exe
  問題簽章 02:14.3.11.1409
  問題簽章 03:53312026
  問題簽章 04:PPJr8
  問題簽章 05:14.3.11.1409
  問題簽章 06:53312026
  問題簽章 07:22f
  問題簽章 08:0
  問題簽章 09:System.NullReferenceException
  作業系統版本:6.1.7601.2.1.0.256.4
  地區設定識別碼:3076
  其他資訊 1:0a9e
  其他資訊 2:0a9e372d3b4ad19135b953a78882e789
  其他資訊 3:0a9e
  其他資訊 4:0a9e372d3b4ad19135b953a78882e789

How can I fix it?  Thanks for any information about it.

Comparing Two Lists in C#.net

$
0
0

Hi All,

I have requirement to Compare two lists.

For Ex: I have created two lists

Class Test

{

String Name;

String Type;

String Region;

String CustomerName;

String IPAddress;

String Values;

};

I have created two lists;

List<Test> Listdata1; List<Test> ListData2;

Listdata1 has 5 lakh records and List2data has 4.5 lakh record.

I need to compare two lists. Each member of each lists i have to do string comparison whether first list member is equal or not with the respective member of second list.

The result i should keep in the third list or in any container which is feasible as shown below:

Result Output be like:

Name   Type    Region   CustomerName   IpAddress       Values     CustomerName   IpAddress            Values

abc1     Male    UnitedAmerica Customer1        10.18.10.252        0.08         Customer1        10.18.10.252     0.9

abc1    Male    UnitedKingdom Customer2   10.18.10.2540.5       Customer3        10.18.10.252     0.76    

abc2    Female    India         Customer3   10.18.10.2420.05Customer510.18.10.245     0.6

abc3     Female    Uk                  Customer4          10.18.20.220       4.5            Customer6       10.18.19.225     12.9

I need to do string compare of each member of two list and somehow i have to  this member is different and this member is same. I have to keep both the list members in the any of the result container. 

Can anyone please give me a good algorithm or feasible solution for the above requirement.

Please give me some good algorithm because it has lakhs of record in both lists. 

You can suggests any other feasible solution also. Whether i can use two lists to compare or is it better to use Two datatables to compare.

Please give me some algorithm.

Thanks & Regards,

Lokesh


Difference between debug and release in .net

$
0
0

What is difference between debug and release? When I am compiling in debug mode, then how compiler knows it is debug mode or release mode. How compiler map break point in code line ( debug mode).

When do I use .NET Core?

$
0
0

Microsoft today released .NET Core 1.0.  

Compared with the traditional .NET Framework 4.*, and the newly acquired Xamarin framework (running on Mono), when should I choose to use .NET Core in my project?

App crashes with error code 80131506

$
0
0

We are using .Net Framework 4.0 and while running the console app the application is throwing below the error and exiting with error code 80131506.

"Faulting module name: clr.dll"

We have uninstalled the existing .NET 4.0 version and reinstalled. It worked properly for one month and again failed with same error. We have two environments, this type of behavior is seen in only one. Both the servers are on version 4.0 and windows 7 servers.

 

passing the arguments to mainwindow

$
0
0
I want to create application which is single instance.but when next time I run same application all arguments show in main window without second instance.

MVC 5 Superadmin and Admin Authentication with Rolemanagement Users [only the superadmin]

$
0
0
Please i need to do a project with Authentication i alredy has this but i need the super admin [CRUD] please any one can help me?
Viewing all 1710 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>