.net

How do I call C++/CLI (.NET) DLLs from standard, unmanaged non-.NET applications?

In the unmanaged world, I was able to write a __declspec(dllexport) or, alternatively, use a .DEF file to expose a function to be able to call a DLL. (Because of name mangling in C++ for the __stdcall, I put aliases into the .DEF file so certain applications could re-use certain exported DLL functions.) Now, I am interested in being ab...

Is it possible that COM interop is affected by the Visual Studio Hosting Process?

I am having problems running a 32-bit .NET application on Windows 7 x64 that seems to center around a 3rd party COM library. Here's the setup: Our application was written for 32-bit Windows XP, but we tried to set things up so that it would run properly on 64-bit Windows. It relies on P/Invoke and COM Interop with several 32-bit 3rd p...

Free/Open Source POP3 libraries

Hi All Just wondering if there are any POP3 libraries for C# that can be used for free in commercial applications (I will give full credit to the POP Library makers, ofcourse)? Thank you ...

Interview Questions: Is IDisposable hard to understand?

I've been interviewing a lot of .NET programmers lately and I haven't met one that knows what IDisposable is or what it is used for. Is it really unreasonable to expect someone with 4-6 years experience to know that? ...

Ensuring an assembly is called via a specified assembly

Is there any built in functionality to determine if an assembly is being called from a particular assembly? I have assembly A which references assembly B. Assembly A exposes PowerShell cmdlets and outputs types that are found within B. Certain methods and properties with in types of exposed by B are of interest to types in assembly A b...

How to stop my emails to be sent as bulk email?

I have a reason to do that. I have recorded a voice message, attached with email, and sent it to several companies. One company, takes that voice message/email, and send it to millions of people. I want to stop resend of my email/voice recording. I am C# develop, one of my client asked me this question. I asked him to introduce verif...

Moq how to correctly mock set only properties

What is the correct way for dealing with interfaces the expose set-only properties with Moq? Previously I've added the other accessor but this has bled into my domain too far with random throw new NotImplementedException() statements throughout. I just want to do something simple like: mock.VerifySet(view => view.SetOnlyValue, Times.Ne...

How do I create a simple seach box with a submit button to bring back a result set in MVC?

I am very new to MVC and just learning the basics. I have been following along in Nerd Dinner and used the demo as a way to create my own app. I have created a page that lists out some food items with calories, fat, protein,etc... (http://rjsfitness.net/CalorieList) This is one of my own personal sites that I set up to test out MVC. ...

Is there a better way to avoid an infinite loop using winforms?

I am using .Net 3.5 for now. Right now I am using a using trick to disable and enable events around certain sections of code. The user can change either days, hours, minutes or total minutes, and that should not cause an infinite cascade of events (e.g. minutes changing total, total changing minutes, etc.) While the code does what I wan...

Unit testing class in a web service in .net

After some digging here, I took the advice in this thread: http://stackoverflow.com/questions/371961/how-to-unit-test-c-web-service-with-visual-studio-2008 I've created a separate class and my web service class is just a wrapper for that one. The problem is that when I try to create a unit test project in VS2008, it insists on creating ...

How to create Web services and link it to Smart device Application?

I am a fresh graduate and hired to develop Smart Device Application.They use Data logic Memoir with windows CE 5.0. Even though i have novice skills in programming in vb.net,I just finish my project and applications for Data logic memoir wherein the data has been save to text file or SQL compact server database in the Handheld Device a...

XPath: Nodes that have a child node that have an attribute

XML Fragment <component name='Stipulations'> <group name='NoStipulations' required='N'> <field name='StipulationType' required='N' /> <field name='StipulationValue' required='N' /> </group> </component> <component name='NestedParties3'> <group name='NoNested3PartyIDs' required=...

Using Effect For Fog of War

I'm trying to apply fog of war to areas on the screen not currently visible to the player. I do this by rendering the game content in one RenderTarget and the the fog of war into another, and then I merge them with an effect file that takes the color from the game RenderTarget and the alpha from the fog of war render target. The FOW Rend...

How to prevent Debug.Assert(...) to show a modal dialog

I have a couple of libraries which use Debug.Assert(...). I think that the Debug.Assert(...) are fine and I still want them to execute, but I don't want them to block the execution of my application. Ideally, I would only like them to be logged somewhere. Given that I can't change the code of the libraries (and that I still want to comp...

Trying to monitor a number of remote MySQL connections

I'm trying to monitor a number of remote database connections. How can I constantly monitor a GMail account for routing emails based on their header within the same application? This will need to be standalone or basic package. Should I build a Qt or .NET app for this? ...

DLL administration

I build some dlls to be used in a big application, and have a team working in the dlls heart of the application and another team working in the gui, but i am having a problems in the deployment of the dll's when a change is done, because the gui team needs or copy the new dll to the project folder, or delete the old reference and add the...

Shared Source CLI 4.0?

Microsoft released the Shared Source Common Language Infrastructure (the code previously known as ROTOR) some years ago basically as a reference implementation of the .NET runtime. While the actual .NET runtime (mscorlib, mscoree, mscorjit, etc.) aren't compiled from the SSCLI, debugging them shows that they are remarkably similar and at...

LuaInterface - how to register overloaded methods?

Hello world! I'm trying to integrate Lua to my C# app when I hit a little snag. I was hoping someone with more expertise could help point me to the right direction. Let's say I have the following C# methods: public void MyMethod(int foo) { ... } public void MyMethod(int foo, int bar) { ... } I would like to register it to my Lua scri...

.NET Threading : How to wait for other thread to finish some task

Assume I have method void SomeMethod(Action callback) This method does some work in background thread and then invokes callback. The question is - how to block current thread until callback is called ? There is an example bool finished = false; SomeMethod(delegate{ finished = true; }); while(!finished) Thread.Sleep(); But I'm sur...

has anyone produced an in-memory GIT repository?

I would like to be able to take advantage of the benefits of GIT (and its workflows), but without the cost of disk access - I just would like to leverage the distributed revision control capabilities of GIT to produce something like a hybrid of memcached and GIT. (preferably in .NET) Is there such a beast out there? ...