clr

does AsyncCallback get invoked when there is exception thrown at the worker thread

不想你离开。 提交于 2019-12-11 17:35:43
问题 I'm new to .net asynchronous programming(Asynchronous Programming Model), just have two questions on the relationship of worker thread and exceptions. Below is an example: private void OnPerformSearch(object sender, RoutedEventArgs e) { WebRequest req = WebRequest.Create("http://www.google.com/#q=weather"); req.BeginGetResponse(new AsyncCallback(Callback), req); // here the main thread calls BeginGetResponse() to enqueues the work in threadpool then a worker thread A will get the job done ...

Why doesn't SQL Server come preinstalled with .net Framework for CLR Integration?

烂漫一生 提交于 2019-12-11 16:59:12
问题 If I want to reference something in the .net framework for use in my CLR stored proc, for example, I have to first load it into the Sql server database. Why isn't it preinstalled? Is it performance related or for security issues or what else? thanks. 回答1: It's off by default because it's increased attack surface area and won't be needed in may places. Lots of other SQL Server stuff has to be enabled specifically too. Some fairly basic stuff can be off by default: KB 914277 for "remote access"

HAA0502 Explicit new reference type allocation

≯℡__Kan透↙ 提交于 2019-12-11 16:08:54
问题 I have ASP.Net Core 2.1 , C# application. I am using Clr Heap Allocation Analyzer https://marketplace.visualstudio.com/items?itemName=MukulSabharwal.ClrHeapAllocationAnalyzer One of the methods looks as below Ex#1 public void ConfigureServices(IServiceCollection services) { services.AddSingleton<IPocoDynamo>(serviceProvider => { var pocoDynamo = new PocoDynamo(serviceProvider.GetRequieredService<IAmazonDynamoDB>()); pocoDynamo.SomeMethod(); return pocoDynamo; }); } Ex.#2 public async Task

Password Encryption / Database Layer AES or App Layer AES

微笑、不失礼 提交于 2019-12-11 16:06:32
问题 I need to encrypt / decrypt passwords for a new application. The spec requires me to use AES; can anyone suggest a good reason to either Do all my encryption in the database layer using CLR functions or Doing it at the .Net app layer ? a mixture of db and server Am going to be validation passwords; the app is n-tiered using Telerik ORM. The only real functions are going to be create/ update password and check the entered value. In my gut i think database is better for validating the users

Can you run a version 3 .Net binary on a version 2 CLR install?

五迷三道 提交于 2019-12-11 15:59:52
问题 We're considering writing the next version of out project in using .Net 3, but are wondering if we can take the hit on forcing end users to install the .net framework version 3. 回答1: If you want to ensure you are only using .NET 2.0 compatible functionality then you should only use .NET 2.0 assemblies. Then you know your safe and sound. 回答2: This article from Jean-Baptiste Evain explains how you can use C# 3.0 and LINQ and targeting machines on which there is only .NET 2.0 runtime installed.

0xC0000005: Access violation reading location 0xffffffffffffffff

让人想犯罪 __ 提交于 2019-12-11 11:54:31
问题 I have: An unmanaged C++ app A C++/CLI Wrapper A C# GUI I am seeing this crash occur only in Release and not debug. The crash also does not occur on neither debug or release when the unmanaged C++ app is run by itself. All I can say is the crash occurs in this line of code: if ((std::find(vstrEEDRRMachines.begin(), vstrEEDRRMachines.end(), m_sFrame.strSourceAddress) != vstrEEDRRMachines.end() && std::find(vstrEEDRRMachines.begin(), vstrEEDRRMachines.end(), m_sFrame.strDestAddress) !=

How to properly configure MSVC's compiler options with QtCreator?

a 夏天 提交于 2019-12-11 10:06:00
问题 I'm trying to migrate from Visual Studio 2008 to QtCreator in a project that uses C++/CLI extensions. This just means that I need to use the -clr compiler option when compiling my files. I've managed to add it by adding the following line to my project.pro file: QMAKE_CXXFLAGS += -clr However, there is a conflicting option in my compiler's call that is conflicting with this one. It is the -EHsc option. But I can't find where these options get included and how to disable it. My default call to

Common Language Runtime detected an invalid program error in unit testing

我怕爱的太早我们不能终老 提交于 2019-12-11 09:07:28
问题 I have the following code this.SafeUpdate(rate, Guid.Parse(import.myGuid), c => c.myGuid); SafeUpdate basically takes the parsed guid value and applies it to the myGuid property on the rate object. This works fine from my front end, but throws the "CLR detected..." error when run in a unit test. What's odd is the same statement for DateTime.Parse and int.Parse works fine. It just fails for Guid and decimals. I don't believe the error is with the parsing (it has the correct parsed value when

Where is return value from function stored

拥有回忆 提交于 2019-12-11 09:06:51
问题 I've read few articles about stack, heap and how they are used in program execution. Here is one of them. It is always said that when calling a function, it's parameters are placed to stack, as well as local variables (strictly saying that's not correct, as Eric Lippert described in his post, but that's not my question now). My question is where the return value from function is stored and how is it passed to the caller? Nobody says it's placed on stack, but still nobody says it's not. Can

does, myval = (someconditon) ? someVal : myval get optimized to not set the value in case it's false

不想你离开。 提交于 2019-12-11 08:15:35
问题 CPath = (CPath == null) ? Request.Path : CPath; First of all I wish CLR would just let me do the ? Request.Path and not bother me with creating a : But I'm asking will it optimize it away? Or still assign. 回答1: Well, I would personally write that as: if (CPath == null) { CPath = Request.Path; } to make it clearer. An alternative (as mentioned elsewhere) is CPath = CPath ?? Request.Path; But why do you care if there's an extra assignment? Do you really think that's going to be a significant