.net

Isolated storage

Hi I am not sure that I understand Isolated storage. I read the article http://msdn.microsoft.com/en-us/library/3ak841sy%28VS.80%29.aspx 1) Why I don't just use App data folder? 2) In the link above : "With isolated storage, data is always isolated by user and by assembly. Credentials such as the origin or the strong name of the ass...

What's the best C# recommendation engine or framework?

Is there anyway to use the examples for the "My Media" Microsoft research project? My Media is a "dynamic personalization and recommendation software framework toolkit" ( http://www.mymediaproject.org ), but out of the box it doesn't provide a sample database (only a LINQ-to-SQL .dbml schema), I don't believe it will be easy to re-create...

How to decrypt a string encrypted with HMACSHA1?

I'm an encryption novice trying to pass some values back and forth between systems. I can encrypt the value, but can't seem to figure out how to decrypt on the other end. I've created a simple Windows Forms application using VB.NET. Trying to input a value and a key, encrypt and then decrypt to get the original value. Here's my code ...

WebBrowser DrawToBitmap other methods?

I am trying to capture the content of the WebBrowser control. DrawToBitmap() would work perfectly, but it is not supported in documentation for the WebBrowser control. I have been trying to find another way to capture the contents of the WebBrowser control and save them to a local image file. Anyone have any workarounds or other metho...

Show dialog after Application.Exit()

Under certain circumstances, I wish to display an error message to the user if the application didn't shut down properly, but MessageBox.Show() doesn't actually do anything after calling Application.Exit(). Is there a way to convince it to show a dialog after Application.Exit()? ...

Best practices for organizing .NET P/Invoke code to Win32 APIs

I am refactoring a large and complicated code base in .NET that makes heavy use of P/Invoke to Win32 APIs. The structure of the project is not the greatest and I am finding DllImport statements all over the place, very often duplicated for the same function, and also declared in a variety of ways: The import directives and methods are s...

TabItem from external XAML is displayed in content area in TabControl. Why and what to do?

Basically this is the following to this: http://stackoverflow.com/questions/1226622/why-are-tab-headers-displayed-in-the-content-area-of-tabs-in-a-xaml-tabcontrol So, I have some TabControl: <Window x:Class="MyApp.HostTest" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.c...

What should happen when a reference is deleted?

I have a vb.net 3.5 application which references a dll (abc.dll, also in .net 3.5) This dll is accessed by the application from time to time. If at anytime during execution, if I delete the dll, I expect the application to throw an error the next time it tries to use a class from the dll. But, this is not the behaviour I see. If I delet...

How to get a reference to IDuplexChannel, IDuplexSessionChannel or IOutputChannel in Wcf

I have a duplex Wcf service and I'd like to get a reference to IDuplexChannel, IDuplexSessionChannel or IOutputChannel so that I can use the non-blocking BeginSend method. On my server, inside of the handler for the initiating method I have the following (I have tried every interface that I listed in place of IOutputChannel. None of the...

.net MVC, dealing with json and Areas

When not using areas dealing with the url for the JsonResults from the clientside is not much of a pain, usually you can get away with hardcoding the url into your json calls and get away with it. Problem arises when you have different areas and you don't want to update all your links when you move a controller (and its views) from one a...

Stafflynx application for Silverlight? Sample code to download?

I found Stafflynx WPF application just amazing: http://www.dnrtv.com/default.aspx?showNum=115 Anyone knows if is applicable for Silverlight? Where can I download it? (sample code) Thanks! Rodrigo ...

Why is OracleDataAdapter.Fill() Very Slow?

I am using a pretty complex query to retrieve some data out of one of our billing databases. I'm running in to an issue where the query seems to complete fairly quickly when executed with SQL Developer, but does not seem to ever finish when using the OracleDataAdapter.Fill() method. I'm only trying to read about 1000 rows, and the quer...

Using the HttpWebRequest class.

I instantiate the HttpWebRequest object: HttpWebRequest httpWebRequest = WebRequest.Create("http://game.stop.com/webservice/services/gameup") as HttpWebRequest; When I "post" the data to this service, how does the service know which web method to submit the data to? I do not have the code to this web service, all I know is t...

VB.NET vs. C#.NET?

The company I work for has all of its legacy ("legacy" being used rather liberally in this context) code in VB.NET. They have about 6000+ lines of VB.NET code, so all of the developers are comfortable with it. We have started to develop a new product, and are finding that some modules are easier to complete in C# than in VB.NET, such as...

WCF Service Library vs Class Library project types

What does a WCF Service Library do that a regular class library doesn't? Edit: I posted my own answer. Am I missing anything? Are they fundamentally both just class libraries with a few template classes added? ...

One class per file rule in .NET?

I follow this rule but some of my colleagues disagree with it and argue that if a class is smaller it can be left in the same file with other class(es). Another argument I hear all the time is "Even Microsoft doesn't do this, so why should we?" What's the general consensus on this? Are there cases where this should be avoided? ...

DataSet.HasChanges is true even immediately after TableAdapter.Update is run

I've got some legacy dataset code which I'm updating. I'm attempting to determine if the dataset has changes to it so I can properly prompt for a save request. However myDataset.HasChanges() always returns true. In my save method I've edited the code to determine when the dataset get's changes and made the code like this: 1. myBindingS...

What is the difference between an error and an exception in .NET?

Could you please explain to me what the difference is between an error and an exception? ...

In 64 bit systems, a 32 bit variable occupies less space than a 64 bit object?

The .NET Framework allocates less memory for a Int32 than for a Int64 in 64 bit systems? ...

System.Runtime.InteropServices.COMException (0x80070008): Not enough storage is available to process this command.

I am trying to diagnose this exception : System.Runtime.InteropServices.COMException (0x80070008): Not enough storage is available to process this command. (Exception from HRESULT: 0x80070008) at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType) at System.Runtime.Remoting.RemotingServices.Alloc...