clr

.NET 3.5 web app - C# image scaling on the fly - lower quality on deployed site vs development

旧巷老猫 提交于 2019-12-13 14:23:15
问题 I have a VS 2008, .NET 3.5 targeted MVC.NET app. I am developing on Windows 7 with its IIS, but deploying to a Windows Server 2003 environment with .NET 3.5 SP1 installed. We have a image scaling action that returns an image from the database in the requested resolution, and converts to PNG on the fly with System.Drawing and System.Drawing.Imaging APIs. The image served up via the deployed site is 1/2 the size/quality of the one in development. The source image is identical, but requesting

Deterministic GC in the CLR?

自闭症网瘾萝莉.ら 提交于 2019-12-13 13:15:22
问题 are there any CLR implementations that have deterministic garbage collection? Nondeterministic pauses in the MS CLR GC inhibit .Net from being a suitable environment for real-time development. Metronome GC and BEA JRockit in Java are two deterministic GC implementations that I'm aware of. But have there any .Net equivalents? Thanks 回答1: There is no way to make the GC deterministic, expect of course from calling GC.Collect() exactly every second using a timer ;-). The GC however does contain a

Obtain non-explicit field offset

倖福魔咒の 提交于 2019-12-13 13:03:29
问题 I have the following class: [StructLayout(LayoutKind.Sequential)] class Class { public int Field1; public byte Field2; public short? Field3; public bool Field4; } How can I get the byte offset of Field4 starting from the start of the class data (or object header)? To illustrate: Class cls = new Class(); fixed(int* ptr1 = &cls.Field1) //first field fixed(bool* ptr2 = &cls.Field4) //requested field { Console.WriteLine((byte*)ptr2-(byte*)ptr1); } The resulting offset is, in this case, 5, because

How to change Powershell CLR version when running commands remotely?

▼魔方 西西 提交于 2019-12-13 13:00:35
问题 I've got a problem trying to run some of our scripts on a remote server. We need all Powershell sessions to load v4 of the CLR, as we're loading in our own custom binaries with our scripts. We've been doing this for some time (we do so using a modified powershell.exe.config similar to here: How can I run PowerShell with the .NET 4 runtime?), and all is well when you RDP into 'Server1' and open a Powershell session. The variable $PSVersionTable tells us that the CLR v4 is loaded. Now that we

Dealing with kanji characters in C++

南楼画角 提交于 2019-12-13 12:34:59
问题 I have a windows deskop application (named: Timestamp) written in C++ that use .NET called CLR. I also have DLL project (named: Amscpprest) written in native c++ and uses CPPREST SDK to get json data from server and pass the data to my Timestamp app. Here's the scenario: This is the return json data from my server, its a list of staff name and most of it is japanese names written in Kanji characters. [ { "staff": { "id": 121, "name": "福士 達哉", "department": [ { "_id": 3, "name": "事業推進本部" } ] }

.NET: with respect to AssemblyVersion, what defines binary compatibility?

喜夏-厌秋 提交于 2019-12-13 11:42:26
问题 What changes to a strong-named assembly necessitate a change in AssemblyVersionAttribute? Clearly, changing the public api in a way that could require a client to have to make a code change requires an increase in AssemblyVersion. But what about changes to the public API that don't require code changes in the client? For instance: the addition of a public class or interface? the addition of a public member to a public class or interface? (EDIT: drscroogemcduck correctly points out below that

C++/CLI - Textbox HideCaret - hide blinking cursor

随声附和 提交于 2019-12-13 08:11:35
问题 Is there any method to use HideCaret() .... or in general, just achieve something like described here: Prevent Blinking Cursor in Textbox but in a Managed C++ (clr) ? 回答1: If you're in C++/CLI, just call HideCaret directly, no need for DllImport . #include <windows.h> System::Windows::Forms::TextBox^ textbox1; HideCaret((HWND)textbox1->Handle.ToPointer()); 来源: https://stackoverflow.com/questions/27803394/c-cli-textbox-hidecaret-hide-blinking-cursor

Debug info hidden when calling C++ function from C# (VS2013)

蹲街弑〆低调 提交于 2019-12-13 07:44:14
问题 I have a VS2013 solution which consists of 2 projects: a C# project and a C++ (CLR/DLL) project I am currently trying to solve these problems, but I haven't been able to so far. If I put a break point in the C++ code and run the C# project, the debugger doesn't break/halt when the C++ code is called from C#. I can't debug (i.e. see the values) of local variables in the C++ entry function: I get this warning when I build the solution in VS2013: C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft

How to reference an assembly which is built against version 'v2.0.xxx' of the runtime in IronPython 2.7?

无人久伴 提交于 2019-12-13 03:39:53
问题 I am trying to create wrapper for an assembly (thirdPartyDLL) which was built against version 'v2.0.50727' of the runtime. But whenever I try to reference it in IronPython code, it always results in following error IOError: 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. My wrapper is a Class Library only, so there is no app.config or app.exe.config. I

SQLDatareader via CLR not returning SQL Message right way

被刻印的时光 ゝ 提交于 2019-12-13 03:31:16
问题 I execute the following code via CLR, is there a reason why the message is not printed to the SQL Server, does it need to wait until the Stored Procedure returns all the rows (there is about 7 Billion rows to return) SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "spCommand_Select_Rows_For_Delete"; cmd.CommandTimeout = 41600; SqlDataReader reader = cmd.ExecuteReader(); try { string strSQL = ""; SqlContext.Pipe.Send