.net

error MSB4018 in vs2017: The “SignFile” task failed unexpectedly

拈花ヽ惹草 提交于 2021-02-05 08:10:48
问题 I have a ppt2013 plugin solution with vsto, developer machines with vs 2017 installed.When I build, it comes the signFile error. I've installed .Net framework 4.5.1 targeting pack .Net framework 4.5.1 SDK .Net framework 4.5.2 targeting pack .Net framework 4.6 SDK .Net framework 4.6 targeting pack .Net framework 4.6.1 targeting pack .Net framework 4.6.2 SDK .Net framework 4.6.2 targeting pack Does anyone have a good idea to solve the error? > detail: D:\Program Files (x86)\Microsoft Visual >

Python objects compared to .NET objects

﹥>﹥吖頭↗ 提交于 2021-02-05 08:10:01
问题 I'm very comfortable with .NET objects and its framework for reference vs value types. How do python objects compare to .NET objects? Specifically, I'm wondering about equality obj1 == obj2 , hash-ability (i.e. being able to put in a dict), and copying. For instance, by default in .NET, all objects are reference types and their equality and hash code is determined by their address in memory. Additionally, assigning a variable to an existing object just makes it point to that address in memory

C# : Pass int array to c++ dll

梦想的初衷 提交于 2021-02-05 08:00:07
问题 I have a C++ dll which is used to card printing( ID cards ). My implementation done using C#.Net. I used following code to call c++ dll. [DllImport(@"J230i.dll",CallingConvention = CallingConvention.Cdecl,SetLastError=true)] public static extern int N_PrintJobStatus(ref int[] nPrtintjobStatus); int[] pJob = {0,0,0,0,0,0,0,0} ; ret = N_PrintJobStatus( ref pJob); N_PrintJobStatus method signature given as bellow N_PrintJobStatus(int *pJobStatus ) After calling the method it gives following

Do I need to synchronize resource access between Tasks with the default TaskScheduler?

允我心安 提交于 2021-02-05 07:58:06
问题 I'm programming with Tasks and await/async. I assumed that the multithreading works like it does in NodeJS or Python, that is, it doesn't, everything just runs on the same thread. But I've been trying to learn how Tasks actually get executed and my understanding is that they're executed by TaskScheduler.Default who's implementation is hidden but can be expected to use a ThreadPool. Should I be programming as if all my Tasks can run in any thread? The extent of my asynchronous programming is

Is there a shorthand way to convert a Tuple to a ValueTuple?

对着背影说爱祢 提交于 2021-02-05 07:56:07
问题 I have just included a DLL file into my project and am using a method which returns a List<Tuple> . I have only recently became aware of the ValueTuple datatype in C# 7 and want to use it instead of the normal Tuples which are returned. I am aware that I could loop through and do the conversion manually however I would like to avoid doing this if possible and was wondering if anyone was aware of a shorthand way to casting a Tuple to a ValueTuple? If I am being ignorant and this isn't possible

C# StreamWriter writes extra bytes to the Stream

自作多情 提交于 2021-02-05 07:51:09
问题 var memStream = new MemoryStream(); using (var sw = new StreamWriter(memStream, Encoding.UTF8, 4194304 /* 4 MiB */, leaveOpen: true)) { var str = new string(Enumerable.Repeat(' ', 10240 /* 10 * KiB */).ToArray()); Console.WriteLine(str.Length); Console.WriteLine(Encoding.UTF8.GetBytes(str).Length); sw.Write(str); sw.Flush(); Console.WriteLine(memStream.Length); } // Output // --------- // 10240 // 10240 // 10243 // Output which I was expecting // --------- // 10240 // 10240 // 10240 I checked

Processing the same .NET assembly with two different obfuscators [closed]

江枫思渺然 提交于 2021-02-05 07:44:40
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . Improve this question Processing the same .NET assembly (feeding the output of one into the other as input) with two different obfuscators increases the chance to make decompilation impossible? Thanks. 回答1: Decompilation is never impossible. It may though quite easily get to

Update ListView when Collection datasource updates

不羁岁月 提交于 2021-02-05 07:34:24
问题 I have ListView which I am binding to a Dictionary collection, but new new items are added to the collection, the listview is not updating. How this can be achieved in WPF? 回答1: Both sides of WPF binding should support INotifyCollectionChanged interface in order to notify about collection changes. Dictionary does not support it. So you can either use ObservableCollection class (it does not provide functionality like search a value by associated key), or you can create you own

Difference between using Task.Yield() in a User Interface and Console App

房东的猫 提交于 2021-02-05 07:23:10
问题 I'm trying to asynchronously show a progress form that says the application is running while the actual application is running. As following this question, I have the following: Main Form: public partial class MainForm : Form { public MainForm() { InitializeComponent(); } async Task<int> LoadDataAsync() { await Task.Delay(2000); return 42; } private async void Run_Click(object sender, EventArgs e) { var runningForm = new RunningForm(); runningForm.ShowRunning(); var progressFormTask =

Difference between using Task.Yield() in a User Interface and Console App

时光怂恿深爱的人放手 提交于 2021-02-05 07:22:27
问题 I'm trying to asynchronously show a progress form that says the application is running while the actual application is running. As following this question, I have the following: Main Form: public partial class MainForm : Form { public MainForm() { InitializeComponent(); } async Task<int> LoadDataAsync() { await Task.Delay(2000); return 42; } private async void Run_Click(object sender, EventArgs e) { var runningForm = new RunningForm(); runningForm.ShowRunning(); var progressFormTask =