.net

Strange problem with .Net inheritance and member visibility

I have a problem in a VB.Net class library which I have simplified greatly down to the following... Public MustInherit Class TargetBase End Class Public Class TargetOne Inherits TargetBase End Class Public Class TargetTwo Inherits TargetBase End Class Public Class TargetManager Public Sub UpdateTargets(ByVal Targets As L...

wmic via .NET or C#

All, Please forgive my ignorance of C#/.NET, I am absolutely new to both (mostly Java, C/C++) and find myself tasked with creating some code that performs the same thing as the "wmic qfe" and "wmic os" commands available at the DOS prompt. Can this be done? If so, any help is appreciated. I am trying to working my way through the Sys...

Deploying to remote server using msbuild in teamcity

OK, I've searched for a few days now and still haven't found what i would deem to be an elegant solution to this problem. Here's what I want to happen. I want TeamCity to Build my code Then test it Then deploy it to a remote server. The first 2 are easy, but nobody seems to have a nice option for deploying. I have set up the server ...

Adding new object to generit List overwrites previous values

Hi guys, I have a problem with a generic list, which consists of intances of a class i created. I am just amazed, each time I add a new object to the list, it overwrites the previous entries. Here is a code sample, i just can't beleive it. I am using visual studio 2010: Dim translations As List(Of TranslatedValue) = New List(Of Transla...

Possible to keep a method from showing up in intellisense?

Say I have a class and I want to deprecate a method. Is it possible to have that method not show up in intellisense so that people won't be temped to use it? I just want existing code that uses it to continue compiling but hide the method from view at the same time. ...

Binding the ItemsSource for a WPF DataGridComboBox Column

Question: Most code samples on the DataGridComboBox seem to use a static resource as the ItemsSource. In my use case, I'd like to provide different ItemsSources with each bound object. Can this be done? Background: I'm trying to bind a collection of Question class objects to a WPF DataGrid, using a DataGridComboBoxColumn control. The...

How to save encrypted and signed messages in WCF for audit

We are building a highly sensitive system, you can think of it as a banking system, where you have a client with a certificate that calls a WCF service to send a transaction to the server. staying in the example of the banking system, that transaction can be a wire order or a debit. So for audit and in case of litigation by the client ...

Learning .NET from F# without C#

Hello, I'm a Java/C++ developer that never spent time in learning C# and the relative .NET foundation. Then I learned OCaml because I had to use it for my master thesis so I heard about F# and wondered: will F# allows me to use easily the .NET API to build fully featured applications (that may involve GUIs, sockets, whatever) without an...

How to determine if all objects are serializable in a given namespace?

Some background: We require all of our DTO objects to be serializable so that they can be stored in session or cached. As you can imagine, this is extremely annoying and prone to error... is there any automated way (ideally as part of the build process) using Visual Studio 2010 to ensure that all classes in a namespace are marked with t...

I have two machine.config files on my server, which one do I edit and how do I verify they are being used?

Hi there, I need to do some performance tuning and need to modify the following settings: processModel, httpRuntime, and connectionManagement. Simple enough I suppose, but I'm not sure which of the two machine.config files to edit, or do I edit both? \Windows\microsoft.net\ Framework \v2.0.50727\CONFIG\machine.config \Windows\microso...

CX_ST_MATCH_ELEMENT:XSLT exception.System expected element - calling SAP PI service from .NET via WCF

I have a C# application that communicates with an SAP function module via a an XI/PI web service. My C# code is using a Visual Studio-generated WCF proxy (generated via the Visual Studio "Add Service Reference..." wizard. I'm getting a System.ServiceModel.FaultException with the message "CX_ST_MATCH_ELEMENT:XSLT exception.System expect...

Implement IDispoable in an Interface

I have a situation where I am defining an interface and then using that directly eg: Dim x as IWhatever = new implementationOfIWhatever() Which is fine, but implementationOfIWhatever also implements IDispoable so I want to be able to do x.Dispose or ideally Using x but get the error that that this is not declared or must implement IDi...

Message Queue terminates program operation.

I'm writing a program which uses a MessageQueue to receive data from another program. It works perfectly on my computer, but bombs on another. Both computers are running XP. I have installed .Net 4.0 Client Profile, and turned MSMQ on, and restarted the computer since then. Via a series of message boxes, I narrowed the error down to this...

access memory mapped file created on .net via python

I made a memory mapped file using MemoryMappedFile.CreateNew(mapName, capacity) of .net 4 Can i access this mmf by the mapName from cpython ? I tried like below. import mmap map = mmap.mmap(-1, 0, mapName, 1) but it returns WindowsError [error 87] saying the parameter is incorrect. I'm using windows vista. ...

Getting System::Type from IronRuby class

I have an IronRuby script like this one: class MyClassA < NamespaceMaze::BaseClass description = "I'm MyClassA" # <snip> some methods end class HelperClass; end class MyClassC < NamespaceMaze::BaseClass description = "I'm MyClassC" # <snip> some methods end And a .net class like this one: namespace NamespaceMaze { ...

c# .Net DateTimePicker problem

this is what I am doing, //this doesnt set the datetimepicker value to the set value class{ constructor { InitializeComponent(); // -> this initializes all the form components DateTimePicker.Value = System.DateTime.Now.AddDays(30); //->trying to set the date time picker value to a date one month from now. } } //...

"not a valid date in accord with the XML format for ABAP" error calling SAP PI web service

I'm getting this System.ServiceModel.FaultException calling an SAP XI/PI web service from my .NET application via WCF: CX_SY_CONVERSION_NO_DATE_TIME:XSLT exception.An error occurred when deserializing in the simple transformation program /1BCDWB/WSSB430AA018B4EA689BF0.Value 7/12/2010 is not a valid date in accord with the XML format for...

How can I generate database tables from C# in order to version control the database?

Currently, changes to the database are made through the SQL Server Management program. IF a table changes, sqlmetal is run to regenerate the linqtosql classes and development continues. However, this makes deployment a pain, as you have to go through and manually update the deployment database (and any other databases used in the devel...

Building an ObjectContext in EF Code First CTP4

I just upgraded to EF Code First CTP 4 and it looks like the ContextBuilder class was removed. I currently create my ObjectContext like so (in CTP 3): var contextBuilder = new ContextBuilder<ObjectContext>(); var connstr = ConfigurationManager.ConnectionStrings["MyConn"]; var connection = new SqlConnection(connstr.ConnectionString); var...

Exposing a class through another class with consistent naming in .net

In the pseudo code below, if I have two classes and I want one class to be initialized in the other class without the name having to be different, how would I accomplish this? '==Car.vb== Public Class Car Public Model as New Car.Model() End Class '==Model.vb== Partial Class Car Public Class Model Public Enum Types ...