Here's an interesting question. I have a system that attempts to run some initialization code. If it fails, we call the deinitializer to clean everything up.
Because we call the deinitializer in exception handling, we run the risk that both initialize and deinitialize will fail, and hypothetically, it now seems that we have to throw two...
I have a PHP script (running on a Linux server) that ouputs the names of some files on the server. It outputs these file names in a simple text-only format.
This output is read from a VB.NET program by using HttpWebRequest, HttpWebResponse, and a StreamReader.
The problem is that some of the file names being output contain... unusual c...
I have an application which tries to load some expected registry settings within its constructor.
What is the most appropriate .NET Exception from the BCL to throw if these (essential, non-defaultable) registry settings cannot be loaded?
For example:
RegistryKey registryKey = Registry.LocalMachine.OpenSubkey("HKLM\Foo\Bar\Baz");
//...
We have a wsdl specifying a datetime element. It is nullable, in the sense that minOccurs=0. However, using svcutil to generate a proxy class does not give us a .net nullable DateTime property, so how best can we make the proxy class serialise the message to a SOAP message that does not contain the datetime element?
...
Is there any simple way to access the DataContext in a linq2sql entity class.
I'm trying to create something like EntitySet but I cannot figure out how the EntitySet has access to the context that created the entity object in the first place.
I want to have a regular linq2sql entity class with a way for the class to access the DataCont...
What's the easiest way to figure out if a window is opened modally or not?
CLARIFIACTION:
I open a window calling
myWindow.ShowDialog();
I have a footer with an "OK" & "Cancel" button that I only want to show if the window is opened modally. Now I realize I can set a property by doing this:
myWindow.IsModal = true;
myWindow.ShowDia...
I generally try and keep all related entities in the same repository. The following are entities that have a relationship between the two (marked with indentation):
User
UserPreference
So they make sense to go into a user repository. However users are often linked to many different entities, what would you do in the following examp...
We have a button that saves asynchronously using AjaxToolKit/C#/.NET. I'm getting this in my Error Console:
Error: [Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException:
An unknown error occurred while processing the request on the server. The status code returned from ...
Hi All,
How do I achieve the equivalent of the LVIS_CUT style for a listview item? It looks like it's not exposed by the framework? Should I P/Invoke?
Edit: LVIS_CUT is a Win32 style that affects the look of the item: It grays the item image. You can see it in action in Windows Explorer: Select a file and type Ctrl+X.
TIA.
...
I need to implement webservices in an upcoming project and wanted to know what are the main points to base the decision on whether to implement using java or .NET
I'm a C++er...
...
We are about to develop a web app from scratch using ASP.Net, and would like it to be as platform-agnostic as possible. As far as I know, the only two options for this are IIS on windows, and Mono (via Apache) on Linux.
The app will be follow the MVC architecture, so with all of this in mind, how difficult is it to develop the applicati...
Hi folks,
in my spare time I'm engaged with writing a little game using Microsofts XNA framework. Reviewing the very first prototype which I wrote to get aquainted with XNA, I found it annoying that there is no possibility to structure my (drawable) game components in a hierarchical manner. I was close to implement a kind of Composite(D...
Everytime i retrieve data from a mysql stored procedure with a concat function an error will occur after binding the datagridview to the datatable that holds the returned rows.
...
What I need to do is convert a C# character to an escaped unicode string:
So, 'A' - > "\x0041".
Is there a better way to do this than:
char ch = 'A';
string strOut = String.Format("\\x{0}", Convert.ToUInt16(ch).ToString("x4"));
...
Background
I have made a Web Service in Visual Studio, and I'm trying to consume it using the automatically generated proxy class. The Web Service returns a class that I have implemented, containing a List.
Question
The proxy class has automatically generated methods to send the SOAP to the web service. It uses the Invoke() method to ...
After reading the proper article in MSDN and related stackoverflow.com questions here, I finally return to the community.
To which extent can a strong-named assembly be verified to avoid tampering?
Is it possible to use strong-naming to verify an assembly author?
The first question arises after reading this CSharp411 article, which ...
I'm currently working on desktop application which calls third party API. After authorizing against their "web service", a kind of user token is returned which should be stored locally (even if user closes application).
So I'm looking for solution to encrypt this token with user specific key. Does Windows (and .NET) provide some stand...
On occasion, I get the following error in design mode of some user controls in Visual Studio 2008:
The file 'UserControl.vb' does not
support code parsing or generation
because it is not contained within a
project that supports code.
It doesn't happen on a consistent basis, but it happens enough to be annoying. Are there any...
I have an assembly that is targeted for .NET 3.5.
I have an application targeted for .NET 2.0 and wonder if I should have any trouble referencing the 3.5 assembly from the 2.0 application.
I understand that the IL is supposedly the same, so I'm assuming that it will work, but would like to hear some experiences from others who have tri...
We are considering Microsoft DSL toolkit for creating some abstract designers. I already did some POCs, but would like to get some opinions on the same.
Any one here to share their experiences working with Microsoft DSL Toolkit and T4? Also, any pointers to open source DSL projects will help - Eg. Microsoft Service Factory modeling edit...