.net

Class library reference problem

I am building a class library and using its default namespace as "System". There suppose I am creating a generic data structure say PriorityQueue and putting it under System.Collections.Generic namespace. Now when I am referencing that library from another project, I can't see PriorityQueue under "System.Collections.Generic" namespace ...

Class library reference problem

I am building a class library and using its default namespace as "System". There suppose I am creating a generic data structure say PriorityQueue and putting it under System.Collections.Generic namespace. Now when I am referencing that library from another project, I can't see PriorityQueue under "System.Collections.Generic" namespace a...

Replacing TCP/IP pipe with WCF

So currently my company is using a TCP/IP connection to talk between server and client programs, right now we are building this connection using System.RunTime.Remoting, which is clunky and not that reliable. It was built about 5 years ago and the model keeps getting reused and it's starting to propagate some issues, ports used, refused ...

In general, how to convert ilasm syntax into Reflection.Emit calls?

I am writing a special-purpose mini-compiler and I often view disassembled CIL to figure out how to do things. But it's often not obvious how to translate the disassembled code to Reflection.Emit calls. Does a reference manual exist or any other source of information for doing this translation? Edit: yes, mapping the opcodes to ILGenera...

.NET TDD with a Database and ADO.NET Entity Framework - Integration Tests

Hello, I'm using ADO.NET entity framework, and am using an AdventureWorks database attached to my local database server. For unit testing, what approaches have people taken to work with a database? Obviously, the database has to be in a pre-defined state of change so that the tests can have some isolation from each other... so I need...

How to set a property of a C# 4 dynamic object when you have the name in another variable

I'm looking for a way to modify properties on a dynamic C# 4.0 object with the name of the property known only at runtime. Is there a way to do something like (ExpandoObject is just used as an example, this could be any class that implements IDynamicMetaObjectProvider): string key = "TestKey"; dynamic e = new ExpandoObject(); e[key] = ...

What is the default connection limit of .Net remoting http channel?

When using .net remoting, does the server limit incoming client remoting calls? I find a particular remoting call (during ASP.NET page rendering) to take from 200ms to 1500ms. While the underlying data call is only 50ms. Factoring in remoting overhead of 150ms per call, the only difference between the two cases is that the latter scena...

Cannot obtain value of local or argument 'hwndSource' as it is not available at this instruction pointer

Hey Guys I'm playing around with Interops and I thought: "Hey let's code something that accesses the clipboard ..." so I googled and found some articles (yeah I'm doing it with WPF - .Net 3.5). However the following method generates an error (as seen in the title) and throws a stackoverflow. private void Window_SourceInitialized(objec...

Loading embedded resource on Windows 7

Hello, I have an app that works just fine on my WinXP machine. However, when I try running it on my Win7 machine, it fails whenever it tries to load an embedded resource. The resources are all there (I can see them using Reflector). The lines that fail are all of the form: Splash.Image = new Bitmap(typeof(ContainerForm).Assembly.GetM...

Why is this variable declared as private and also readonly?

In the following code: public class MovieRepository : IMovieRepository { private readonly IHtmlDownloader _downloader; public MovieRepository(IHtmlDownloader downloader) { _downloader = downloader; } public Movie FindMovieById(string id) { var idUri = ...build URI...; var html = _downlo...

Reflection: How to get the underlying type of a by-ref type

I was surprised to learn that "ref" and "out" parameters are not marked by a special attribute, despite the existence of ParameterInfo.IsOut, ParameterInfo.IsIn (both of which are always false as far as I can see), ParameterAttributes.In and ParameterAttributes.Out. Instead, "ref" parameters are actually represented by a special kind of ...

w3wp.exe keeping files locked after processing in webservice

Hi, I have a webservice and I noted that some dlls in the wwwroot folder are kept logged after the webservice is executed. After restart of pc, the problem is solved. Can i have something in my code that releases the dlls? ...

Is there any implementation of .NET for Mac OS?

I know this might sound awful. Is there any implementation of .NET for Mac computers so I can write C++.NET apps for the library (like GTK+ etc.)? ...

Why use VB.Net instead of C#?

A big company says At least knowledge not to ask "Why don't you use C#?" in its job requirements. And as a C# coder I wonder why do they prefer vb.net instead of C#. Also a Microsoft MVP uses vb.net in his Silverlight applications. Is there something Microsoft won't tell us? ...

Is there any extension method which get void returning lamda expression ?

For example int[] Array = { 1, 23, 4, 5, 3, 3, 232, 32, }; Array.JustDo(x => Console.WriteLine(x)); ...

What Application.Run( ) does ?

Hello Everybody I was thinking that WinForms are classes as any other classes. But starting form project get me confuse. Why new Form start with Application.Run and what kind of mechanism happen inside of it ? ...

I'm having trouble pushing my source code from my local drive to CodePlex using Visual Studio 2010 Ultimate.

Codeplex gave me the relevant information for proper connection, and I connected to my repository using the Team > Connect to Team Foundation Sever in VS 2010 Ultimate. Here is what I see: How can I push the code I have made on my machine, to the repository on CodePlex? ...

What's the proper approach for writing multi-path "story" flows?

Hi, I wonder if you can help me. I'm writing a game (2d) which allows players to take multiple routes, some of which branch/merge - perhaps even loop. Each section of the game will decide which section is loaded next. I'm calling each section an IStoryElement - And I'm wondering how best to link these elements up in a way that is easi...

sending AT COMMANDS

does anyone know where i can get the official list of all AT COMMANDS available? i would like to get my computer speaking to my cell phone. i need all AT COMMANDS and i will hook it up to either .NET or VBA or anything else. btw i have a motorola phone ...

Event type can't be Action<> ?

Hello everybody this works public event Func<int,int> createEvents; but why not this ? public event Action<int> createEvents; ...