I have a .Net application that needs to run several executables. I'm using the Process class, but Process.Start doesn't block. I need the first process to finish before the second runs. How can I do this?
Also, I'd like all of the processes to all output to the same console window. As it is, they seem to open their own windows. I'm sure...
I'm trying to access a method of text file, I use this first:
Get-Item file.txt | get-member
Then I would like to use the GetType() method, but it says it doesn't recognize file.txt as the name of a cmdlet,function,script file or operable problem. I need to access that or any other method :D
...
Hello,
I'm building C#/.Net 3.5 app using three layers: UI (view/view models), service, and data access/persistence.
Service Layer:
Each service layer instance is associated with a unique persistence instance. The service layer references the persistence layer via an interface.
Persistence Layer: Right now, the persistence layer in...
Why does the DataContractSerializer bypass initializers?
Background:
The serialization formatter gets uninitialized instances of classes during deserialization. That is, instances where all fields are set to their default values. For reference types this will be null. That is why "authors" in this case causes a null reference except...
You need to pull a large amount of data (thousands of entries) from a local SQL server to be used in generating a report. You have two options:
1) Use a single query to get the data from the server, load it into a .NET data table and use a series of loops to get the information you need
2) Perform an SQL query each time you need a rec...
I have a Windows Service (written in .NET 1.1) running under a specific user account and instances of the service running on several servers.
I would like to pass user credentials (username, password, domain) to the service from a WinForms application and have the service read/write files in the server's local file system impersonating...
I've been working as .NET developer for a few years now and have no other windows development experience worth noting. Now I'm in a position where I have to use and maintain .NET code that uses older VB6 code. Other people are maintaining and replacing this code but for the next couple years I'll have to live with it.
As far as I can t...
Dear StackOverflow, :-)
For the past eight months or so, I have been banging my head on my keyboard out of frustration because I can't make Windows Identity Foundation do the things that I want it to do.
Even more frustratingly, WIF doesn't seem to enjoy the widespread adoption of many other MS .net technologies. I often cannot find w...
I have a string that needs to be validated.
The first two characters must be made up A-G, or Z, but cannot be the following combination: GB or ZZ.
How do I express that in a regular expression?
...
In my application, I have a "recent files" drop down menu. It will contain anywhere between 0 and 9 files to load. I want to set shortcut keys on these menu items such that Ctrl+1 loads the first file, Ctrl+2 loads the second, etc...
I understand that I need to set the ShortcutKeys property of the ToolStripMenuItem but I am looking for ...
I've been working on a WPF application. Since I design the UI in Expression Blend 4 and work on the code-behind part in Visual Studio 2010, I constantly switch from one tool to another.
I added some Image controls to an existing Grid and assigned some images to them. In Blend, I built the project and ran it. Worked just fine. When I swi...
I have an simple custom object called MyObject (a couple of basic properties and a List(of MyObject), so it's recursive) that I need to serialize for storage. I'm not sure if I'll serialize to XML or Binary yet, but I want to make sure I'm using the most up-to-date methods for doing it, as there are a few different namespaces involved an...
This seems to be asked a lot on the internet, but so far my research hasn't produced a solution. (And, at least for now, I haven't accepted "it can't be done" as a solution.)
At its simplest description, what I'm trying to do is have a config file in a .NET class library project that is available to that class library in any applicatio...
Since resharper still doesn't give out any warning regarding objects implementing IDisposable, I'd like to create some custom search patterns available in resharper 5.0.
So far I have this:
(And don't mind my replace comments in the patterns, I don't really care about it, I just want a clear warning in the code when dealing with dispos...
Dumb question, but I just can't seem to get it to work. I'm passing in parameters and returning string values, but all I receive is: org.apache.http.conn.EofSensorInputStream. Do I need to do something special in my web service to access the parameters being passed?
...
I need to format output according to the type of the DataColumns in a DataTable.
Specifically, I need to map the built-in primitive types (int, string, decimal, DateTime, etc) to:
SomeEnum.Numeric
SomeEnum.Bool
SomeEnum.DateTime
SomeEnum.String
SomeEnum.Unknown
SomeEnum.Null
How could I do this?
...
Is there a way to find what exception was caught by .NET code from the outside of the application?
I found that 3d party API throws an exception and suppresses it (I see the perf counter going up).
But it doesnt shows it in trace (I tried sysinternals dbgView).
What tool can show a caught exception?
...
Hi
I am trying to use the debug and release versions of the webconfig but it never works. I am trying to do this for a 3rd party library that I am using called combres.
http://combres.codeplex.com/
So I first put all the needed web.config code in the web.config. Now I have 2 different .xml files(thats where you put your javascript and...
in .net, if I have a generic class SomeClass<T>, is it possible to use the where keyword to require that T is a class with a certain attribute? something like:
[SomeAttribute]
class MyClass
{
...
}
class AnotherClass<T> where T : Attribute(SomeAttribute)
{
...
}
...
I am experimenting with the Tcp connections in .NET and I would like to send some data that is larger than the SendBufferSize proporty of the TcpClient object. Is it possible to send the data by simply writing to the network stream or do I need to cut it in pices and send those and at the other end create it again?
...