.net

How can I grant permissions for a FTP Folder for users of the active directory

I have a asp.net web application that creates a Folder on a FTP site, but I need to grant permissions to that folder to some users of the active directory. How can I do that programatically, inside my app when I create the folder? ...

How to design an app that requires synchronized notifications on all client computers

We have an asp.net application that needs to be expanded to notify users when an update occurs. All users need to be notified even if they don't have the asp.net app opened. All notifications must occur at the same time for everyone, so email is not an option. The application will run on a corporate network with standardized client co...

Solution Wide Analysis Broken in Resharper 4.5?

I'm having trouble with solution wide analysis since I upgraded to resharper 4.5. I'm continually getting false negatives, and having resharper report errors with my code that are not there. I find the only way to get rid of the errors is to open each of the reported in error files, find the offending types/classes, open those files an...

Linq dynamic select casting issue

I want to run a query to get a string array of distinct "logName" items for a logType. The following works great: Dim stringArray() As String = (From item In dc.Vw_Logs Where item.LogType = [Passed in logType] Select item.LogName Distinct).ToArray() However, this only works when a specific LogType is set. I would like the ...

Any ideas on how to write a static analysis rule (FXCop) to ensure that event delegates are removed

We have been going through a big memory leak analysis and have found one of the contributing factors has been the non removal of delegates on events causing objects to not be GCed quickly enough (or sometimes forever). Would anyone have any ideas as to how to write a rule in FXCop to ensure that we have delegates are removed from handl...

How can I add line breaks to the serialized output of a SyndicationFeed object?

I'm using the SyndicationFeed class to generate an Atom feed and an Atom10FeedFormatter to serialize it. I'd like to be able to add line breaks between the elements when the file gets written to disk. I realize the feed readers don't care, but when I run my docs through http://feedvalidator.org/ it treats the whole doc as a single line...

DataGridView bound to a Dictionary.

I have a Dictionary that contains items and prices. The items are unique but slowly get added and updated through the lifetime of the app (i.e. I don't know the item strings in advance). I would like to bind this structure to a DataGridView so I can show updates on my Form, something like: Dictionary<string, double> _priceData = new Dic...

Will values in my ThreadStatic variables still be there when cycled via ThreadPool?

I am using ThreadStatic variables to store some data, but I am worried that the data I store on the thread will still be there after I am finished with it and release back to the ThreadPool. Do I need to worry about clearing my ThreadStatic variables before I am finished with the thread? Or will the ThreadPool do this for me before "pa...

Mini Web Server for .NET

I wrote a VB.NET windows service and I'd like to know if there is some library or something that will provide me with a very simple mini web server. If my service is running, I'd just like to be able to type, in my browser: http://localhost:1234 And have a status page popup. It will only be one single page and very simple html. Anyone ...

Invalid Postback error when Databinding a gridview.

I really hate this error, because it can be so hard to pin point. In this case, I have a page with a user control on it that contains a gridview. When a button is clicked to view one of the records in the gridview, a pop-up window (in the form of a modal dialog) opens allowing the user to edit the fields. Then, when the pop-up is clos...

How do you prevent the browser from displaying a cached version of a page?

One solution would be to add a QueryString variable to the url that is a random guid, but that seems a little messy. Is there a setting somewhere that will prevent the browser from displaying a cached version of a page? ...

What is meant by WS-*?

I have seen the abbreviation WS-*, but I have not been able to figure out what this means, and why is it important? ...

Does Convert.ToBase64String return the same length as it's source byte array ?

I don't know if i am asking a silly question but I want to know whether Convert.ToBase64String function in .NET returns the same length as it's source byte size or is it different? I wanted to try out the article from MSDN itself How To: Use Forms Authentication with SQL Server 2000 to hash my password but I found out that the function t...

WPF: How to make canvas auto-resize?

I would like my canvas to automatically resize to the size of its items, so that the ScrollViewer scroll bars have the correct range. Can this be done in XAML? <ScrollViewer HorizontalScrollBarVisibility="Auto" x:Name="_scrollViewer"> <Grid x:Name ="_canvasGrid" Background="Yellow"> <Canvas x:Name="_canvas" HorizontalAlignme...

How to pass a method as parameter without declaring a delegate in .NET

No matter how I try, I cannot mimic the clean syntax of Rhino Mocks, without declaring a delegate. Example: Expect.Call(service.HelloWorld("Thanks")) Do you have any idea on how to do this? Thanks. ...

How can I get a transparent background for a DataForm in Silverlight 3?

I can't seem to get a transparent background for a DataForm in Silverlight 3 beta. The code below is what I am trying but it only makes the background partially transparent. Is there something I can do to fix it? <Grid x:Name="LayoutRoot" Background="Orange"> <Border Background="Blue" Margin="100,0,0,100"/> <Controls:DataForm ...

WCF Encryption solution for App.config viewable to a client?

I have a desktop application which contains an App.config (program.exe.config at release) with clearly visible elements which define my WCF endpoints and WCF implementation. I would ideally like to hide this from the users eyes, from simple hacking, view and change. Should I: - Programmatically create and store my WCF endpoints and b...

Best Practice for view data population?

I've been working on a .NET application and experiencing a memory error (I'm a java developer that can do other things), I've been thinking about performance. What I'm posting about was not the memory problem. The memory problem just started me thinking. I've repeated a trend in my ASP.NET application that I've used on countless J2EE ap...

CodeSmith v.s. T4: .netTiers level suite

Has someone ported the netTiers template set to Visual Studio's T4 templates? Or is there a system of similar scope? Does anyone use T4 in a work environment? What (if any) major differences are there between Codesmith and T4? ...

Serializing objects to a text file: which API/framework?

I want to save my program's DataModel objects to a file, and be able to reload the same object graph again. I want it to be in some flavor of text file, so I can diff it and open it in a text editor. XML would be fine, and seems like a good place to start since .NET has XML serialization built in. But which flavor of XML serialization s...