.net

microsoft technology similar to j2ee servlets?

I have a java application which runs under Tomcat. Fairly simple architecture - users invoke a servlet through HTTP which then puts a request onto an in memory queue. A consumer thread which was started as a ServletListener and is running continuously polls the queue and processes the requests which includes calling some stored procs a...

ASP.NET MVC - Set Master View accordingly with Controller

Hello There, By any chance, is there any easy way to set a default MasterView for all the actions inside a specific controller? For example If I have the HomeController I want all the actions inside it to inherit the Site.Master as default, but If I am inside AccountsController I want all the action to inherit the Admin.Master and so o...

How to correctly pass XML strings between a custom TCP client / server?

Hello, I'm working on a C++ client/server project where XML strings are passed over a TCP/IP connection. My question is about the proper way to indicate the complete string has been received. I was thinking of null terminated strings or sending the length of the XML string first, so the client/server can tell when a complete string is ...

Instantiating a class using Reflection

Suppose I have three projects in my sln. (1) xyz.a{Class Lib}{no reference added} (2) yzx.b{Class Lib}{added the reference of xyz.a} (3) zxy.c{Console App}{added the reference of xyz.a} Now, I need to create the instance of a class residing in yzx.b from within xyz.a using reflection. And also this should be independent of the folder...

PEVerify Warning Parameter out of Sequence

I've built an assembly using Reflection.Emit. Running PEVerify returns 214 warnings of the same type: [MD]: Warning: Parameter out of sequence (parameter: 1; seq.num: 1). [token:0x06000171] Unfortunately there isn't much documentation around these sort of issues. I'm guessing because it's a metadata warning it's something to do with ...

Is there a .NET framework similar to Ruby's Sinatra?

Does anyone know if there is a .NET library/API similar to Ruby's Sinatra? Just wondering since with the new Routing API in ASP.NET MVC, WCF and .NET 3.5, it seems like a possibility. ...

How can I reproduce a SHA512 hash in C# that fits the PHP SHA512?

Hello :) The question is pretty much self-explanatory. I Googled many sites, many methods, tried many encodings, but I can't get it to match. I'm trying to make the string "asdasd" match. (http://www.fileformat.info/tool/hash.htm?text=asdasd) ...

parse iCalendar date using c#

Is there a direct way to parse an iCalendar date to .net using c#? An iCalendar date looks like this: 2009-08-11T10:00+05:0000 I need to parse it to display it in a friendly format... thanks ...

How to Specify NOT with Regular Expressions for Words

How to Specify NOT with Regular Expressions for Words I want to filter a list of event names based on a regular expression. I can create a regular express to include (or match) name, but what would be the regular express to exclude (not match) a name? For instance, if I want to include mouse events then the pattern would be "^Mouse". I...

Is there really any difference between NUnit, MSTest, etc.?

Is there really any difference between NUnit, MSTest, etc.? For example, can any of them detect what code changed since the last build and only run the affected unit tests? Do any of them have tight integration into database setup/rollback for integration-style tests? Do any of them allow for scripting TCP ports or web services to tes...

LINQ: Create persistable Associations in Code, Without Foreign Key

Hello, I know that I can create LINQ Associations without a Foreign Key. The problem is, I've been doing this by adding the [Association] attribute in the DBML file (same as through the designer), which will get erased again after I refresh my database (and reload the entire table structure). I know that there is the MyData.cs file (as ...

Trouble with XML Deserialization into XSD generated classes

I have a rather detailed xml file. Below is the top level nodes (I have included the ellipse as the lower level nodes are all well formed and properly filled with data): <?xml version="1.0" encoding="UTF-8"?> <config> <Models>...</Models> <Data>...</Data> </config> I have created an xsd file from using the Visual Studio 2008 ...

Alternatives of persisting data using C#?

I have a small application in C#, and so far I have implemented it using data persistence classes that are running SQL directly, I understand there are better alternatives as Hibernate.NET and possibly Spring.NET. There are some other I forget? pros and cons? thanks! ...

How to attach properties (thru .NET infrastracture or any else)

I have a WPF application and I added to the project resources many icons and bitmaps. Now I can access them like this: Dim ico As System.Drawing.Icon = My.Resources.Icon 'Icon.ico Dim img As System.Drawing.Bitmap = My.Resources.Image 'Image.png In order to use it in wpf I created too simple Extension Methods that convert them to Imag...

.NET Network tracing only for Debug builds

I have enabled .NET network tracing per this article here: http://msdn.microsoft.com/en-us/library/ty48b824.aspx Unfortunately, the log files are generated for both Release and Debug builds even though TRACE is not enabled for my Release build. I'm trying to find a way to leave the logging enabled for the Debug build and disabled for ...

Mocking vs. faking, when to use what?

Can anyone come up with a guidelines kind of stuff, suggesting the ideal scenarios when to go for mocking or faking (setting up the essentials manually). Bit confused with the approach? ...

Tracing and diagnostics for System.Data.SQLConnection

Hi i was wondering if there is away to allow tracing / diagnostics on a SQLConnection via the app.config file much like you can with WCF when you need tracing support (as below)? <system.diagnostics> <switches> <add name="DataMessagesSwitch" value="0" /> <add name="TraceLevelSwitch" value="0" /> </switches> </system.di...

Auto update: Is this secure?

Dot Net Auto Update I felt like .net was lacking a simple secure automatic update library so I've implemented something and put it up here. Before anyone considers using the library I was keen for the update process to get a bit a peer review. Here are the steps: The client software is populated with a public key and URI to poll. Cl...

Is this thread safe?

private static bool close_thread_running = false; public static void StartBrowserCleaning() { lock (close_thread_running) { if (close_thread_running) return; close_thread_running = true; } Thread thread = new Thread(new ThreadStart(delegate() { while (true) { lock (close_thread_running) { ...

Unable to find module 'mscorwks.dll'

Hi all I try to use the winDBG to debug a dump file. When I run .loadby sos mscorwks.dll It gave me an error message. Unable to find module 'mscorwks.dll' Has anyone seen this before? Best Regards, ...