.net

Blogging engine A to Z

Hi Guys, I want to start writing my own blogs but have few queries before I start doing that. I was recently reading David Hayden's article and he is under pain as the blog engine he is using is of dark ages and it doesn't go well with current technologies and interface. I would like to know A to Z of getting started with one of the be...

The remote name could not be resolved: 'localhost'

How can the application not be able to lookup localhost? The remote name could not be resolved: 'localhost'; StackTrace; at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String me...

What is the difference between C & C# on the basis of OOP concepts?

What is the difference between C & C# on the basis of OOP concepts? ...

Which Windows Phone 7 emulator is new?

I just now installed Windows Phone 7 Developer tools Beta. I noticed that the icons on the emulator differ from the icons in the web site, demos, samples etc. Mine looks like this; But other uses a different emulator like this; Why is that? which one is real? or latest? ...

How to refactor a class that is serialized in .NET?

I have a C# class that is serialized to disk by the BinaryFormatter, such as this example: // Version 3.0 [Serializable] public class Person { public string FullName; [OptionalField(VersionAdded=2)] public string NickName; [OptionalField(VersionAdded=2)] public DateTime BirthDate; [OptionalField(VersionAdded=3)...

Error: The assembly "c:\MyAssembly.dll" could not be converted to a type library.

I'm trying to build my project and I've suddenly started getting the following error when the project builds and the "Register for COM interop" property is ticked. The assembly "c:\MyAssembly.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'SomeType, MyAssembly'. Error: Refer...

Quick questions about updating code from RIA Services July Preview to RIA Services 1.0

I don't have much experience on the web services / database abstraction layer side of things for Silverlight, and am caught on an aspect of my porting effort. There was a core C# developer on the project that is no longer involved, and I'm working with code that he wrote. I'm updating code on a SL3 project with the RIA Services preview ...

Problem with c# events

I need to implement Pause and Resume events of a MP3 player inside the same button click event. following is the code i have tried and its not working,Can any one give me the solution private void button3_Click(object sender, EventArgs e) { if (button3.Text == "Pause") { CommandString = "pause mp3file"; mciSendSt...

Programming against a PLC via OPC protocol with C#

I'm running this code to connect to a plc. System.Guid guid=new Guid("75d00bbb-dda5-11d1-b944-9e614d000000"); System.Type t=Type.GetTypeFromCLSID(guid,node,true); object COMobject=System.Activator.CreateInstance(t); opcServer = (IOPCServer) COMobject; using the opc protocol as previously mentioned. I have little to no ex...

Sending arguments to an app-instance that resides in another process

I have a single-instance app (c#, WPF, .net3.51). The check if the app is already instantiated is done via a Mutex. If the app is already running, I open a new window from within the already opened app-instance. This works fine so far. However due to an app extension, I now must send the e.Args (or at least the first string of it) to t...

Is it possible to detect if the main application thread is running as a Windows Service without using a compilation directive?

I need to do the check in a method contained in a shared library that is referenced by a windows forms application and a windows service. When we do the check in console mode, I must allow potential dialogs. In case of the windows service, I will write messages in the event log instead. I found many way to do that using compilation dir...

Bug Reporting Web Service in .Net

Following up to my old question here: http://stackoverflow.com/questions/3125248/vb-net-secure-passwords-to-database Where would a person start who wants to make a web service to allow a public desktop application to submit bug/crash data to a MS SQL Database without containing the database information. I created an app a while ago and...

Can you configure IIS7 to autostart a Windows Process Activation Service (WAS) application when the application pool starts/recycles?

IIS 7.5 introduces the notion of auto-start providers, that allow you to get WAS to auto-load an application or assemblies when an application pool starts up. Can a similar thing be acheived with IIS7? Basically, we have an application that runs under WAS, and has an in-memory cache of data. When an application pool recycle occurs, my ...

How to Create a browser plugin, to check whether browser playing video

Hi, I want to report to my boss whether can able to create cross-browser plug-in, which is used for check whether browser playing video (or flash). With Regards Vadivelu ...

.net thread monitoring

Hi I want to monitor one thread from another thread.currently looking at threasd.isalive property. If there is any exception in thread still thread.isalive property is true. I want to kill thread if there is any exception in thread or if the thread is in infinite loop.. Would appreacite for your inputs/solutions/suggestions. Raju ...

Why is it not possible to catch MissingMethodException?

I have a dependency on .NET 2.0 SP2 in my ClickOnce deployed application (the ApplicationDeployment.CurrentDeployment.CheckForDetailedUpdate(false) method is SP2 only). I would like to check whether SP2 is present during app startup. I have tried to detect this by catching MissingMethodException after calling a SP2-only method. ///...

PDB files with .EXE or .DLL extension

I have a .net 4.0 web project which is running in debug mode. This was running perfectly until recently. Now it errors saying it can't fine various PDB files. The PDB files it is looking for is are all present. However looking at the trace .NET is trying to find them with either a .pdb.exe or .pdb.dll extension. Why is it looking for the...

LightSwitch: How do I place my business logic into a separate assembly?

I have no idea how to do this simple task. LightSwitch's Solution Explorer is different in the sense that it doesn't allow to add other projects such as Class Library. Even if I could add a Class Library I would still need to reference the data model from it. As the data model is inside the LightSwitch project I would have a circular ref...

Diffrances in Localized Versions of the .NET Framework

I am wondering what the differences are in localised versions of the.net frameworks running under application the same culture code (i.e. application is not localised). So far I understand that: Exception Messages are localised so appear in foreign language The Names of countries in the framework are localised is there anything els...

Generate hash code based on object identity in .net

How can I generate a hash code for an object based on its identity. What I mean is that: if object.ReferenceEquals(a, b) == true, then a and b will get the same hash code. if object.ReferenceEquals(a, b) == false, then a and b should have a decent chance to get different hash codes even if they are memberwise equal. What I have is: ...