.net

"A timeout was reached while waiting for the service to connect" error after rebooting

I have a custom-written Windows service that I run on a number of Hyper-V VMs. The VMs get rebooted a couple times an hour as part of some automated tests being run. The service is set to automatic start and almost all of the time, it starts up fine. However, maybe 5% of the time, with no pattern that I can discern, the service fails to...

Java AWT in .NET

Is there an equivalent for Java AWT that works on .NET? I usually use IKVM for Java bytecode translation, but IKVM AWT support is fairly limited. ...

Downloading Castle.Core and adding [AllowPatiallyTrustedCallers]

I want to run Castle.Core under medium trust, and I know how to do it in theory. Add [AllowPatiallyTrustedCallers] to the Assembly.cs Disable Trace Logger - (because it uses reflection) First problem, there is is no Assembly.cs, so apparently you can use nant to build with a command line like: nant -D:assembly.allow-partially-trust...

Getting a business layer to communicate with presentation.

Hey, So I'm working on a small TicTacToe application over the holidays to improve some of my skills. I have a two layered approach right now where there is a project for the presnetation and a project for the business end of the game. My question is what is the best way for the State.cs class to tell the WinUI that we have had nine tu...

IE does not display a .NET Windows Form control.

I have an identical asp.net application hosted on two computers, PC1 and PC3 on the intranet. The .NET control is hosted using the object tag. The following three url when executed on PC1 work properly: http://pc1/test/test.aspx (The other two urls have pc1 replaced with pc3 and localhost) All three urls in IE v8 show the page with t...

How to move local DateTime values through different time zones

What is the best way to store/retrieve a DateTime value that is created by an application with a specific local date and time, stored in a database on a server that may be in a different time zone, then retrieved by other devices in a different time zone, where those devices need to interpret the DateTime value with the same local time a...

Store custom application settings in XML

Hi everybody, please help. I have this code, it's my class to serialize\deserialize application settings. public static MyConfigClass myConfigClass = new MyConfigClass(); private static String myConfigFileName = AppDomain.CurrentDomain.BaseDirectory + "\\ApplicationConfig.xml"; [XmlRoot("EvaStartupData")] [Serializab...

Thread security in sandboxed AppDomain

I have application domain to host untrusted code/assembly. I solved all problems with security with security attributes and it works well. The untrusted code runs on dedicated thread. CLR is 2.0. This is what I have AppDomainShell AppDomainSeed, Shell is running in main domain, seed is trusted proxy/helper in untrusted domain. I'm inter...

What's a good pixelation algorithm in C# .NET?

What is a good algorithm for pixelating an image in C# .NET? ...

How do I get access to an image of the desktop buffer in .NET ?

I am making a very simple app in C# with Visual Studio, so I'm using that Forms package. I need to get access to an image of everything below it, so that I can manipulate the image. How can I do this? It doesn't have to be real time very much, since I'll probably be polling it not more than say 10fps. ...

WCF assembly causing circular dependencies.

I have a silverlight library which I have added a wcf service reference. Call this library A.dll. This library contains other functions and I prefer to have the wcf code in another library. I now have created another silverlight class library which I have added the same wcf service reference (call this library B.dll) and want the first...

How does the BackgroundWorker class fire its events on the UI thread?

I'm in the process of writing a asynchronous-operation manager somewhat similar to the BackgroundWorker class. I know that the BackgroundWorker does some internal voodoo (using the AsyncOperation class, from what I've read) to fire its events on the thread that created the BackgroundWorker, which is typically a UI thread. My question is...

C# - Good way to expose Nullable<T> to COM

We are working on exposing an assembly to COM. Among other things, we frequency use nullable values such as long?, DateTime?, etc. These are generic types and can't be exposed to COM. What is a good substitute for these data types for COM? We have tried the following: //Original CustomerID property in class public long? CustomerID {...

Native C++ and C# interop

So I'm architecting an application that does necessarily C++ work, but MFC/ATL is too messy for my liking, so I had this brilliant idea of doing all the "thinking" code in native C++ and all the pretty UI code in C#. The problem, though, is interoperability between the two of them. Before I get too carried away with this, I was wondering...

Recommended method for loading a URL via a scheduled task on Windows

I have a webpage hosted on a Windows box that I need to assure gets loaded at least once/day. My current plan is to create a scheduled task that opens Internet Explorer and hits the URL: "C:\Program Files\Internet Explorer\iexplore.exe" myurl.com/script_to_run_daily.aspx This was simple to setup and works fine, but it strikes me as a ...

How to read tags out of m4a files in .NET?

I've got some heavily modified code that ultimately came from the Windows Media SDK that works great for reading tags out of MP3 and WMV files. Somewhere along the line, Windows Media Player added support for .m4a files (was it in Windows 7?) but the Windows Media API doesn't seem to reflect that addition (or at least IWMMetadataEditor2:...

System.Web.Extensions Assembly cannot be resolved

I am trying to run a .NET 4.0 Console application that references a sister library project (Bar.dll) which itself references System.Web.Extensions in VS2010 B2. I am currently only interested in getting access to System.Web.Scripting.JavaScriptSerializer. Both projects have references to System.Web.Extensions (using the one listed under...

Why do I get "AccessDenied" when trying to use HttpListener?

Win 7 and VS2010 B2. I am trying to write a minimal web server using the built-in HttpListener. However, I keep getting an AccessDenied exception. Here is the code: int Run(string[] args) { _server = new HttpListener(); _server.Prefixes.Add("http://*:9669/"); _server.Start(); Console.WriteLine("Serv...

Google Checkout API callback URL issue

I am able to process orders no problem. However when I look in the integration console I see the following error: We encountered an error trying to access your server at https://[urlremoved]/registerpayment.aspx -- the error we got is Send failed with code: 401. Response body was: 401 - Unauthorized: Access is denied due to invalid...

Installing SQL Server and .NET Framework from a visual studio setup project

I have to do four things install .net framework 3.5 ,install SQL Server 2005 and run my sql script on the server and create the database and install my application how to do it in a single setup project using visual studio 2005/2008 ...