.net

Do not copy SASS / LESS file when using Web Publish

大兔子大兔子 提交于 2021-02-08 01:48:05
问题 When publishing a Web Application (MVC in my case) via File System in Web Publish setting, most of the *.scss & *.less files get deployed as well. How do I configure a Visual Studio project so that it does not deploy these files? 回答1: I believe setting "Build action" to "None" and "Copy to output directory" to "Never" should work. You can do it in property window of the file. Right click the file in solution explorer and click properties 回答2: Visual Studio deploys only those files that are

Does MassTransit support MSMQ over HTTP transport?

好久不见. 提交于 2021-02-07 23:52:13
问题 HTTP transfer has been available since MSMQ 3.0, however I'm afraid MassTransit doesn't offer the feature to use HTTP protocol as transport protocol between queues. There's a very similar question about this here, which has not been completely answered. Does anyone know if it's possible for a client to subscribe to a bus and send/receive messages through HTTP? Here's the architecture I'm willing to implement: I'll have 2 computers in the local network Computer A runs a server application and

How can I get the seed from a Random already created

早过忘川 提交于 2021-02-07 23:15:04
问题 I have to be able to repeat an experiment made with my code, it makes a few random numbers and I need to get the initialization value of my new random() sentence. I have this sentence to make the random object I use Dim r As Random = New Random() As I have read it gets the initialization value from system datetime. If the experiment were successfull I'd needed to be able to repeat it. How could I get the initialization number to be able to do: Dim r As Random = New Random

How can I get the seed from a Random already created

£可爱£侵袭症+ 提交于 2021-02-07 23:14:03
问题 I have to be able to repeat an experiment made with my code, it makes a few random numbers and I need to get the initialization value of my new random() sentence. I have this sentence to make the random object I use Dim r As Random = New Random() As I have read it gets the initialization value from system datetime. If the experiment were successfull I'd needed to be able to repeat it. How could I get the initialization number to be able to do: Dim r As Random = New Random

.NET Core/MVC - View Posting Null Model Back to Controller

自作多情 提交于 2021-02-07 22:00:58
问题 I'm using C#/.Net Core and MongoDB. My edit action takes in a model that contains a list of string values and then needs to edit each value in that list. However, when I call the edit (submit) action, my model is null or returns an empty list. Edit get: [HttpGet] public IActionResult EditUser(string userId) { if (userId == null) return NotFound(); var user = _mongoService.RecordLookup(userId); if (user == null) return NotFound(); var viewModel = new EditRecordViewModel { Records = user };

Making asynchronous code cancellable

青春壹個敷衍的年華 提交于 2021-02-07 20:33:22
问题 I have some time-consuming method: public class TimeConsumingClass { public void TimeConsumingMethod() { //let's imagine my method works this way for (var i = 0; i < 10000; i++) Thread.Sleep(); } } It was executed in main thread previously. Then I needed to call it in secondary thread to not block UI: Task.Factory.StartNew(() => { new TimeConsumingClass().TimeConsumingMethod(); }); And now I need to make it possible to stop this method at any time. So I want to make my method treat

TPL Dataflow Transform block post to batch block followed by actionblock

泪湿孤枕 提交于 2021-02-07 20:27:57
问题 I have a TPL Dataflow based application, that worked fine using only a batch block, then an action block. I've added in a TransformBlock to try and trasnform the data from the source before posting to the batch block, but my action block is never getting hit. There are no errors or exceptions being thrown. I am unsure if I need to complete my transform block, as it only seems to be being hit once. Is there a step that I need to add to my transform code other than returning an object of the

TPL Dataflow Transform block post to batch block followed by actionblock

天大地大妈咪最大 提交于 2021-02-07 20:26:18
问题 I have a TPL Dataflow based application, that worked fine using only a batch block, then an action block. I've added in a TransformBlock to try and trasnform the data from the source before posting to the batch block, but my action block is never getting hit. There are no errors or exceptions being thrown. I am unsure if I need to complete my transform block, as it only seems to be being hit once. Is there a step that I need to add to my transform code other than returning an object of the

MS Charts: Getting the real InnerPlotPosition?

▼魔方 西西 提交于 2021-02-07 20:24:19
问题 When creating charts using Microsoft Charts, I need to get the exact position of the grid on the chart. This page says -- as I understand it -- that this can be achieved with InnerPlotPosition. However, when using this property, I get the following rectangle: This rectangle seems to scale with the chart size; when resizing the chart, the rectangle shrinks, but still keeps on the outside of the grid on all edges. I have tried both adding and multiplying the sizes with a constant, but no single

There is no row at position 0

自古美人都是妖i 提交于 2021-02-07 20:22:03
问题 cmd.CommandText = "select * from product where prod_code='" & Trim(txtprod_code.Text) & "' and branch='" & w_location & "' and avail_stock <>" & (0) & "" cmd.CommandType = CommandType.Text con.Open() da_uqc.SelectCommand = cmd cmd.Connection = con da_uqc.Fill(ds_uqc) m_qty = ds_uqc.Tables(0).Rows(0)(4) 'error da_uqc.Dispose() ds_uqc.Dispose() cmd.Dispose() Is it possible to give like this m_qty = ds_uqc.Tables(0).Rows(0)(4) ? 回答1: You're getting a run-time error denoting that there was no