.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

sgen.exe and Visual Studio Integration

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :.NET Framework
I have looked around for a solution to this problem, but I surprisingly can't seem to find one.  I am working on a command and controls C# WinForms application that communicates with a server backend using XML messages.  We have an XSD that defines what a valid XML message can be.  I have a project in my solution that holds only the XSD and the generated C# classes.  I am using XML serialization to translate C# object to XML messages and vice versa.  I have a post build event that uses sgen.exe to generate the prebuilt XML serializer assembly.  The problem is that to use this prebuilt XML serialization assembly you either have to add it to the GAC, or add it as a reference to your project.  I don't want to have a build event that copies the DLL to the GAC, I think it would be irresponsible to be copying dlls around the system just to do basic development.  I also don't want to be manually adding the dll as a reference every time we update/regenerate the C# classes. Is there a way I can easily add the dll as a reference to my project automatically (not manually) every time it is updated, or some way to let .NET know where to get the assembly without putting it into the GAC? Thanks -Chris

View Complete Post

More Related Resource Links

Problems with integration of SQL CE 3.5 SP1 in Visual Studio 2008 SP1

Hi all,   Hope someone can help with this one.   I have Visual Studio 2008 installed (with every option except reporting) and SP1. I recently installed SQL 2008 Express, Windows Mobile 6 SDK and SQL CE 3.5 SP1 SDK (Windows/Mobile/Server Tools/Books Online).   Problem is when I add a CE database to my project, I get an error popup saying that there was a Package Load Failure and that I should reinstall SQL CE 3.5 SP1 then restart.  Another dialog follows this with more details (shown below):   Package 'Microsoft.CompactFramework.Design.Data.CFDataPackage, Microsoft.CompactFramework.Design.Data, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has failed to load properly ( GUID = {B65E9355-A4C7-4855-96BB-1D3EC8514E8F} ). Please contact package vendor for assistance. Application restart is recommended, due to possible environment corruption. Would you like to disable loading this package in the future? You may use 'devenv /resetskippkgs' to re-enable package loading.   I have Googled this and there is not much help on this out there. I have tried various suggestions including: i) Removed Windows Mobile 6 SDK, Repaired Visual Studio, re-installed Windows Mobile 6 SDK, ii) Reinstall Visual Studio 2008 SP1 iii) Uninstall, restart, then reinstall SQL CE 3.5 SP1   And none seem to fix it.   Can anyone shed any light on this? I've spent a day and a half on this a

Visual Studio can not run with more than 2 database integration tests


I have written some database integration tests in the format of MS unit test. If I run each test, it runs fine. If I run 2 integration tests, it runs fine. However, if I runs 3 or more test at the same time, one test will show "In Progress", and other shows "Pending", basically, it does not make any progress at all, stays there forever. I turned on SQL Server Profiler, it does not show  the test hit the database at all. What can I do to resolve the problem?

Here are some examples of my method:

 Public Function GetOneByJoin(ByVal ID As Integer) As DataTable
        Dim cmd As SqlCommand = New SqlCommand()
        cmd.CommandText = "GetOneByJoin"
        cmd.CommandType = CommandType.StoredProcedure
        Dim dt As New DataTable
        Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
        cmd.Connection = Me.conn

            cmd.Parameters.Add(New SqlParameter("@ID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, ID))
            '// Open Connection
            ' // Execute query.
            Return dt
        Catch ex As Exception
            Throw ex

ASP.NET 4 and Visual Studio 2010 Web Development Beta 2 Overview

Many exciting changes for ASP.NET are coming in the .NET Framework version 4. This document gives an overview of many of the new features that are included in the Beta 2 release of the .NET Framework 4 and of Visual Studio 2010.

Visual Studio 2010 Beta 2

This is a big deal. This isn't ".NET 3.6" - there are a lot of improvements of .NET 4, and it's not just "pile on a bunch of features so you get overwhelmed." I've been working with and talking to many of the teams involved and even though it's a cheesy thing to say, this is a really customer-focused release.

ASP 4 - Whirlwind Tour around .NET 4 (and Visual Studio 2010) Beta 1

There's a lot of stuff that's new and added in .NET 4, but not in that "overwhelming-I-need-to-relearn-everything" way. More in that, "oh, this is way easier/simpler now" way. Like, moving data around with ADO.NET DataServices is easy, binding with client templates is easy, there's F# if you need it, the "dynamic" keyword if you need it, Silverlight's already installed, oh, and the parallel stuff will freak you out, but in a good way.

Short Overview of SharePoint Features in Visual Studio 2010

As you probably know, Visual Studio 2010 was announced earlier this week and it contains a lot of cool features and project templates for SharePoint developers. Below is a short overview for some of the SharePoint development related features and project templates.

Visual Studio Add-In for Web Parts Generation

This article will introduce you to a new Visual Studio 2005/2008 add-in that can be used for Web Parts generation based on a prepared ASCX control/template. The add-in should allow Web Part developers to easily make Web Parts using the Visual Studio HTML designer. It should save you a lot of time and make Web Part development an enjoying experience even for beginners.

This article is written in the form of a step-by-step tutorial. It will give beginners a chance to successfully make, deploy, and try their first Web Parts, and will save some time for advanced users as you can always run into challenges when working with SharePoint.

Code spelling checker extension for visual studio 2010

Building a spelling checker for source code as an extension for visual studio 2010.

Download and Share Visual Studio Color Schemes

The good news is that Visual Studio allows you to completely customize the editor background and text colors to whatever you want - allowing you to tweak them to create the experience that is "just right" for your eyes and personality. You can then optionally export/import your color scheme preferences to an XML file via the Tools->Import and Export Settings menu command.

Visual Studio Shortcut Keys

The following tables describe the shortcut keys in the Microsoft Dynamics AX Debugger.

Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



Visual Studio 2008 Memory problems


My memory in task manager reaches about 900,000K  and I don't know why it does this. Definately slows everything down, especially when I rebuild my tableAdapters, takes about 30 seconds sometimes to rebuild the project.

is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site p


is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site project


my current project references




i have a very annoying iis problem

iis server stops working until app pool is recycled


i am hoping that new visual studio (net framework 4.0) may solve this very annoying unsolveable problem


About Dynamic Data in Visual Studio 2010 / .NET 4



Does anybody here have any pointers to screencasts, demos, webcasts for the latest enhancements in Dynamic Data as listed in above link? I'm repeating them here for ready reference :


  • EnableDynamicData method which enables Dynamic Data features in existing ASP.NET applications and DataSource controls
  • A new QueryExtender control, contained in the sample projects to simplify common data filtering operations. It supports a rich ASP.NET declarative query syntax that makes it easy to do things like search data for text or have filters based on ranges
  • A new Dynamic Data filter model that enables the developers to apply templates to pages just like field templates (including user defined filters)
  • New field templates of Email, URL and Enum columns
  • Support for inheritance in Entity Framework and Linq to SQL
  • Support for many to many relationships in Entity Framework
  • New Entity Templates which allow fine control over how an object is displayed and edited
  • DynamicHyperLink control for building links to tables and actions
  • Declarative support for D

Error while setting up application on Win7 using Visual Studio.NET 2003


Hi All,

Getting the below error while setting up application on Win 7 using visual studio.NET 2003.


cannot find the components for communiacting with the front page server extensions...


I understand by the error, i need to install Front page server extension, but not able to figure how to install using IIS 7.5.

I had XP machine with IIS 5.1, able to find the option.


Need your help in resolving this.




Business Intelligence Reports Project in Visual studio 2008 ?



I wonder how to add a project template called  Intelligence Reports, something like that, to Visual studio 2008. I have SQL 2008 installed. Do I need to install some updates to get Intelligence Reports template to Visual studio 2008 ?

Thank you..

HttpHandler works with Visual Studio Development Server debugging, but not otherwise


Hi all,

I'm new to HttpHandlers.  I am writing an HttpHandler that reads uploaded files directly from the request stream to provide progress that can be queried using an AJAX request.  For large files, this seems to be faster than having ASP.NET load the file contents into Request.Files and then streaming the file from there to wherever it goes (Linq to SQL into a VARBINARY column in an SQL Server database.)

My HttpHandler works perfectly when I'm debugging using the Visual Studio Development Server, but doesn't work otherwise.  The application pool for this application in IIS 7 is set to run in Classic Mode, and the Handler Mappings screen in IIS says that I must manage managed handlers in system.web/httpHandlers. 

I set up in my applications Web.config file.

<add verb="GET,POST" path="*.upload" type="Namespace.For.UploadHandler, AssemblyForUploadHandler"/>

It works great, so long as I don't debug with the "Use Local IIS Web server" option.

What else do I need to do to get this to work?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend