.net

Where can I find, or how can I build, a cartoonizer for C#?

I am working on the development of a Massively Multiplayer Online Role Playing Game (MMORPG) in .NET using C# and Silverlight. One of the features that has been requested for this game is to allow players to upload their own avatars. Rather than displaying the uploaded images in their raw forms, we want to convert the images to a cartoo...

Entity Framework - Cannot convert lambda expression to type 'string' because it is not a delegate type

I am using Entity Framework in my C# based code. I am running into an unexpected weirdness and am looking for suggestions. Case 1, 2, 3, 4... Projects: RivWorks.dll RivWorks.Service.dll RivWorks.Alpha.dll Samples (all of these work): RivWorks.Alpha.dll: public static bool EndNegotitation(long ProductID) { var product = (from a ...

Is there any way to add references without recompiling in .NET?

I am using a IoC Container (Castle Windsor) to instantiate classes accordingly to the configuration file. If I want to add classes from a new dll that didn't exist when I compiled the project, there is any way to do that without recompiling? Edit: As this project is a Service Host for WCF service, and the classes that I want to include ...

Is there a way to inject code at build time?

I want to inject the following line into the top of every method of my application Trace.WriteLine(this.GetType().Name + "." + "Name of Method"); I'd like to do it at compile time or build time or post-build - basically before it gets into customer's hands. Is this possible? ...

What is the accepted pattern of killing background tasks in a WinForms app

I got a .net WinForms application. I have a UserControl which gets instantiated based on user action - upon instantiation, it performs some time-consuming tasks on a background thread (using BackgroundWorker), while displaying the ajaxy spinning animation. The user can click away at anytime, then click back onto the user control (which...

Output first two paragraphs from html stored as string

Hi, I have html stored in a string variable within my c# .net 2.0 code. Below is an example: <div class="track"> <img alt="" src="http://hits.guardian.co.uk/b/ss/guardiangu-feeds/1/H.20.3/30561?ns=guardian&amp;pageName=Hundreds+feared+dead+in+Haiti+quake%3AArticle%3A1336252&amp;ch=World+news&amp;c3=GU.co.uk&amp;c4=Haiti+%28News%29%...

What reporting tool do you suggest for an enterprise level ASP.Net MVC application?

In one of the enterprise-level projects, we are using ASP.Net MVC for the web application portion. The reporting system is a huge system with hundreds of reports plus adhoc reporting, printing and notifications, the whole nine yards. Although we are using MVC for the web portion, the reporting doesn't need to be in the same technology, ...

[.NET CF] memory usage of multiple control instance

I am building a application with on WM6.1, few question about the resource control. My app is build by vs2008/.NET CF 3.5 one of the window form, I place only one webbrowser control, and run the program, then open the control panel and view the memory usage of applicationm it grow from 25MB to 29MB,nothing special. After that, I need p...

Problem with Nhibernate.Bytecode.Castle in MSBuild (TFS)

We have a Fluent NHibernate mapping test that is passing on our local machines, but when we check in to TFS, the tests are failing on the build server. We are using MSTest. The error we get is: NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.By...

pls correct my code: Problem loading tabs dynamically

Hai i m trying to load the tabs dynamically.(Using AjaxToolKit). Firstly, when i hit button1 on pageload, it loads tab1() (works good) and when i hit button2, itloads up tab2() All these tabs are ascx pages. In tab1 i m loading WebUserControl.ascx. it works okay. Issues: 1) When you runthe code, first click on button2, it doesn't load...

Debugging Visual Studio and Adobe Flash together

Most of my applications are a combination of VB.NET and Adobe Flash, such that the VB application is displaying a Flash file inside the main form (using Adobe's COM object). The VB application is communicating with the Flash file via the ActionScript ExternalInterface and FSCommands (using XML strings). I'm having a hard time debugging ...

lost with DataSets and merging in C#

NEWEST EDIT!!! PLEASE... I have been through many permutations of this code. I am attempting to take some certain related records from a database (SQL server) and export to XML (which seems to work!), and take them to a disconnected copy of that database, and import them to that database, merging them by primary key (updating if the k...

Proper Interop Cleanup

I have the below method for spellchecking in my in house app. As a new programmer this was pieced together through multiple sources and tweaked until it worked for me. As I grow and learn I come across things that make me go, hmm. Like this SO post,How to properly clean up Excel interop objects in C#, that talks about proper Interop...

Mocking webservice calls...sometimes

I am trying to write acceptance testing for an existing app. I've run into a problem though when calling a web service that tells us if a person is, in short, in the office or not, what hours, and who the backup is. In most of the tests, actually calling the web service is fine... yes, ideally it shouldn't, but creating inputs and outp...

Contextual or Drop down window

I am elaborating on how to set the window style to behave like the context menu or the combo-box drop down list - to be able to close when user clicks outside the window area or presses Escape but I have found no clue. I have already used the ToolStripDropDownButton to simulate this behavior quite well but there is one big issue that th...

Make attributes incompatible with each other?

Is there a simple way to make my attributes incompatible with each other? C# .net ...

Multiple descendants types linq

I sometimes do this: XElement.Descendants("mynodename"); is there a way to do something like this" XElement.Descendants("mynodename or myothernodename"); ...

SqlError.Number descriptions

Where i can get all the descriptions of the SqlError.Number collection? This are throwed by SqlException ...

Where is the implementation of System.ServiceModel.ServiceHost.Dispose()?

I am using Reflector but I can't find System.ServiceModel.ServiceHost.Dispose(). Where is it? ...

Cursor to return multiple rows

Hello experts, I've been working on this for the past few days and I can't find my way out of it. I have a C# web application that needs to print reports on screen. This same application calls a stored procedure on the database (Oracle) and it returns a cursor. Here is the procedure PROCEDURE report_total(beginDate IN DATE, endDate IN D...