Request a topic or
contact an Arke consultant
404-812-3123
All posts by trenton adams

Arke Systems Blog

Useful technical and business information straight from Arke.

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Archive

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2022

To display an assembly in the Add Reference dialog box

FROM:

http://msdn.microsoft.com/en-us/library/wkze6zky.aspx

 
  • Move or copy the assembly to one of the following locations:

    • The current project directory. (You can find these assemblies by using the Browse tab.)

    • Other project directories in the same solution. (You can find these assemblies by using the Projects tab.)

    • The Public Assemblies folder: Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Public Assemblies. (You can find these assemblies on the .NET tab.)

  • Set a reference path to the directory that contains the assembly by using the Reference Paths Dialog Box (Visual Basic) or the Reference Paths Page, Project Designer (C#).

  • Set a registry key that specifies the location of assemblies to display:

    Add one of the following registry keys, where <AssemblyLocation> is the directory of the assemblies that you want to appear in the Add Reference dialog box, for example, C:\MyAssemblies\.

    [HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"

    Note:

    Creating the registry key under the HKEY_LOCAL_MACHINE node allows all users to see the assemblies in the specified location in the Add Reference dialog box. Creating the registry key under the HKEY_CURRENT_USER node affects only the setting for the current user.

    Invoke the Add Reference dialog box again; the assemblies should appear on the .NET tab. If they do not, ensure that the assemblies are located in the specified <AssemblyLocation> directory, restart Visual Studio, and try again.


Posted by trenton adams on Friday, May 9, 2008 3:25 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Strong Names on Third Party Assemblies

I need to strong name a few third party assemblies so that I could include them in a compile of a strongly named assembly that I was creating.  I found this site that did a great step by step on getting this working.

http://www.andrewconnell.com/blog/archive/2004/12/15/772.aspx

 

 

  1. c:\>ildasm providedAssembly.dll /out:providedAssembly.il
  2. Rename/move the original assembly
  3. c:\>ilasm providedAssembly.il /dll /key=keypair001.snk

Posted by trenton adams on Thursday, May 8, 2008 4:27 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Installing Debian and Subversion on Hyper-V (DRAFT) - Updated

Part 1: Setting up the Hyper-V VM

 

The network adapter was the tricky part.  I mentioned the fix in this previous post:  http://arkesystems.com/blog/post/2008/04/Hyper-V-Miscellaneous.aspx

 

Part 2: Installing Debian - Lenny

  1. Start the Debian install
  2. When it asks for you to create a user DO NOT use the same username as your AD account, this will just be confusing.  Use something else, or something like 'defaultdebianuser'.
  3. When it asks for software selection choose the following:
    • Standard System
  4. Now wait while it finishes the initial install.
  5. Reboot
  6. Login as root
  7. Install sudo  #>aptitude install sudo
  8. Setup your network settings:
    • #> sudo nano -w /etc/network/interfaces
    • Create a static entry such as:

      allow-hotplug eth0
      iface eth0 inet static
      address 192.168.1.57
      netmask 255.255.255.0
      gateway 192.168.1.254

      auto eth0

    • Save and exit
    • #> sudo nano -w /etc/resolv.conf
    • Update the domain, search and nameserver fields
    • Save and exit
    • Restart the machine and re-login
  9. install the ssh server #> aptitude install ssh
  10. You can now ssh into the machine so you don't have to be on the actual box in order to finish setting subversion up.
Part 3: Connecting to the Active Domain

We have our base install of Debian now, and it's available via ssh.  We now need to install the necessary components for connecting to the Windows Domain.

  1. Modify the sources list accordingly
  2. #> sudo apt-get update
  3. #> sudo aptitude install libkrb53
  4. #> sudo aptitude install krb5-config
    • Asks for the AD server's hostname 
  5. #> sudo aptitude install samba
  6. #> sudo aptitude install winbind
  7. #> sudo aptitude install ntpdate
  8. #> sudo apt-get install ntp-server
  9. The previous items may ask for some configuration options, you can fill them in if you know them otherwise we'll be modifying the configuration files later...
  10. #> sudo /etc/init.d/samba stop
  11. #> sudo /etc/init.d/winbind stop
  12. #> sudo /etc/init.d/ntp stop
  13. #> sudo nano -w /etc/krb5.conf
    • Under the [realms] section add your AD controller's Hostname (if it's not already filled in from the configuration)

      REALMNAME {
      kdc= ARKEDC

      }

    • Look for the default_realm parameter and set it equal to your domain name.  The domain name MUST BE IN ALL CAPS.  For example, ARKESYSTEMS not arkesystems or arkesystems.com
    • Save and Exit
  14. #> sudo ntpdate <ip of the time or AD server>
  15. #> sudo nano -w /etc/ntp.conf
    • Add a server like:
      • server <ip of the time or AD server>
    • Save and exit
  16. #> sudo /etc/init.d/ntp start
  17. check to see if this is working so far by:
    • #> ntpq -p
    • If it has your server in the list you good to keep going.
  18. #> sudo nano -w /etc/samba/smb.conf

      realm = ARKESYSTEMS.COM
      workgroup = ARKESYSTEMS
      security = ads
      idmap uid = 10000-20000
      idmap gid = 10000-20000
      template shell = /bin/bash
      template homedir = /home/%D/%U
      winbind use default domain = yes

    • Save and quit
  19. #> sudo nano -w /etc/nsswitch.conf
    • Add the winbind flag to the passwd and group field:

        passwd: files winbind
        group: files winbind

      1. In Lenny it will look like

      passwd: compat files winbind
      group: compat files winbind

  1. #> sudo ldconfig
  2. What we've done in the last few steps is synced the debian box with the time server.  They both need to be within a few seconds of each other in order to properly authenticate on the domain.  We then setup our user folders and samba authentication.  Finally we added the ability of Debian to validate against the AD for users.  We're now ready to attempt to join this machine to the domain. .
  3. ... But first add an entry for this machine in the Active Directory ...
  4. #> sudo net ads join -U "DOMAINADMIN"
  5. #> sudo /etc/init.d/samba start
  6. #> sudo /etc/init.d/winbind start
  7. use the getent passwd and getent group commands to check to see if they're listing the users and groups from your domain.  If they are not, double check your config files.
  8. Next we're going to configure PAM (Pluggable Authentication Module Subsystem)  This allows programs in the Linux environment to authenticate through the domain. We've got to update three configuration files to use the winbind extensions

      # sudo nano -w /etc/pam.d/common-account
      account sufficient pam_winbind.so
      account required pam_unix.so

      # sudo nano -w /etc/pam.d/common-auth
      auth sufficient pam_winbind.so
      auth required pam_unix.so use_first_pass

      # sudo /etc/pam.d/common-session

      session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
      session sufficient pam_winbind.so
      session required pam_unix.so

  9. Now we need to edit our skeleton files for users who logon to debian for the first time.
    • #> cd /etc/skel
    • #> sudo mkdir .ssh
    • #> sudo nano -w .ssh/authorized_keys
    • Save and Exit
    • #> sudo chmod -R 744 .ssh
    • #> sudo nano -w .bashrc
    • add the line: umask 007 at the bottom, save and exit
    • #> sudo nano -w .bash_profile
    • change the umask to 007, save and exit
Part 4: Installing and Configuring Subversion
  1. #> sudo apt-get install subversion
  2. **THE FOLLOWING IS ONLY IF YOU WANT WEB ACCESS**
  3. #> sudo apt-get install apache2
  4. #> sudo a2enmod dav_fs
  5. #> sudo /etc/init.d/apache2 force-reload


Categories: Server 2008
Posted by Trenton Adams on Tuesday, April 15, 2008 12:11 AM
Permalink | Comments (3) | Post RSSRSS comment feed

Hyper-V Miscellaneous

So I've been working on getting 2 VMs setup in Hyper-V today, a Windows 2003 server and a Debian Server.  Below are the issues I ran into and how to solve them.

 

Windows Server 2003 Standard

The main issue I ran into here was the inability to run the full Microsoft Update web site.  Basically when I clicked on Custom update, it would process for a while then end with an 0x80072ee2 error.

To fix this you have to disable TCPIP offloading.

  1. Run->regedit
  2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
  3. Add a REG_DWORD key/value pair:
    1. DisableTaskOffload = 1

Restart and you'll be able to access Microsoft's updates again.

 

Debian 4.0R3

The problem I ran into here, is that Debian does not detect the default Hyper-V virtual network adapter.  To fix this you'll need to go to you're VM's Settings page.

  1. Select the network adapter and delete it
  2. Select the Add Hardware option
  3. Add a new Legacy Network Adapter
  4. Modify settings on this as needed

You'll now be able to install Debian on the VM, and the installer will detect the network adapter

 

kick it on DotNetKicks.com

Posted by Trenton Adams on Friday, April 11, 2008 3:58 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Asp:LinkButton as an Asp:Panel's Default Button in FireFox

The asp:LinkButton doesn’t work as a panel's DefaultButton in FireFox

Here’s a link explaining the issue:

http://kpumuk.info/asp-net/using-panel-defaultbutton-property-with-linkbutton-control-in-asp-net/

I’ve written a custom control similar to the one in the article (Arke:LinkButton). Which fixes the FireFox issue.

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Arke.Web.UI.WebControls
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:LinkButton runat=server></{0}:LinkButton>")]
public class LinkButton : System.Web.UI.WebControls.LinkButton
{
protected override void OnLoad(System.EventArgs e)
{
Page.ClientScript.RegisterStartupScript(GetType(), "addClickFunctionScript", _addClickFunctionScript, true);
string script = String.Format(_addClickScript, ClientID);
Page.ClientScript.RegisterStartupScript(GetType(), "click_" + ClientID, script, true);
base.OnLoad(e);
}
private const string _addClickScript = "addClickFunction('{0}');";
private const string _addClickFunctionScript =
@"  function addClickFunction(id) {{
var b = document.getElementById(id);
if (b && typeof(b.click) == 'undefined') b.click = function() {{
var result = true; if (b.onclick) result = b.onclick();
if (typeof(result) == 'undefined' || result) {{ eval(b.href); }}
}}}};";
    }
}

To use this control...

  1. Add "using Arke.Web.UI.WebControls;" to your code behind.
  2. Register the assembly in the Asp.NET page "<%@ Register Assembly="Arke.Web" Namespace="Arke.Web.UI.WebControls" TagPrefix="Arke" %>"
  3. Add the control (or change your asp:LinkButtons to Arke:LinkButtons) "<Arke:LinkButton ID="ArkeLoginButton" Text="log in" runat="server" CssClass="login_button" />"
View Trenton Adams's LinkedIn profileView Trenton Adams's profile

Posted by Trenton Adams on Thursday, March 13, 2008 1:16 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Using the connection strings in your web.config for LINQ

I ran into a problem with using LINQ when deploying code to different environments, when the dbml and the web code were in separate assemblies.  After doing some research I ran across the following blog by Rick Strahl: LINQ To SQL and the Web.Config ConnectionString Value

It's a good read, and really helped me understand what's going on under the hood with the LINQ connections.  Anyway, I ended up writing a partial class that allowed me to keep the nice default constructor with LINQ DataContexts, and also use a simple connection string in the web.config file.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebProject.Data
{  
    public partial class WebProjectDataContext   
    {       
        public WebProjectDataContext() :
            base(System.Configuration.ConfigurationManager.ConnectionStrings["WebProjectConnectionString"].ToString(), mappingSource)       
        {           
            OnCreated();       
        }   
    }
}

 

You'll need to change your LINQ classes' DataContext Properties so that it doesn't read from the app.config file (set connection to NONE).  That will keep LINQ's code generator from creating the default constructor.  You can then place a partial class like the one above in the assembly.  LINQ will then use your web.config's ConnectionString when creating the DataContext with the default constructor.

View Trenton Adams's LinkedIn profileView Trenton Adams's profile

 

kick it on DotNetKicks.com


Posted by trenton adams on Wednesday, March 5, 2008 8:01 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Web Application Foundation - Part 2 - Preparing a client machine with Visual Studio 2008 for Continuous Integration (Draft)

The first part of this article series dealt with setting up the Continuous Integration server with CruiseControl.NET and related tools.  This article will deal with the tools, components, and configurations you need to set up on your development workstation in order to take full advantage of the CI environment.  Along with a few other items for consideration.

Installing the Deployment Project Extensions:

Web Deployment Extensions for Visual Studio 2008

Basically the Deployment Project will pull all necessary files and assemblies into a file structure that will allow for easier deployment from the developer's machine to another web environment.   The Deployment project will also combine and prepare all the web project's application code into a versioned assembly and .compile files.

To install the extensions...

  1. Make sure that all instances of Visual Studio are closed. 
  2. Download the msi from the link above. 
  3. Run it as administrator, and follow the wizard.

 

 

WiX (Windows Installer XML):

WiX - Homepage

You will need the weekly build version 3.0.3621 or better in order for the project to correctly load in VS2008.

WiX is a setup and installer framework created by Microsoft, and used as the installer for a number of programs including Office 2007.

Why WiX instead of the Visual Studio Setup Project?

There are number of reasons for this (below), but the most important one is that MSBuild does not know how to handle .vdproj (setup) projects.   (segway:  MSBuild is the build platform in .NET roughly equivalent of other programs such as ANT or make)

MSBuild is important if you plan on using Continuous Integration with a program like CruiseControl. 

WiX is also based on XML.  WiX projects and files are roughly human readable and easily allows for extensibility by following the XML spec.

To Install:

  1. Download WiX version 3.0.3621 or later
  2. Make sure that all instances of Visual Studio are closed
  3. Run the msi as administrator

This install will also include Votive (not supported in Express Editions) 

Also...

"ProjectAggregator2.msi, which is available here. This is a small COM component that the Visual Studio SDK framework requires. It has very minimum impact on your system and has a clean uninstall. This is only required for Visual Studio 2005. For Visual Studio 2008, this is no longer a requirement. "

 

NAnt:

http://codebetter.com/blogs/jeffrey.palermo/archive/2007/11/28/upgrade-nant-for-use-with-vs2008-solutions-and-net-3-5.aspx

CCTray:

Cruise Control Tray is a notification tray tool that monitors your build projects on the server.  It will inform you when a project is building correctly on the server, failing, and when it makes a new build.    To install the CCTray on your workstation, go to the web address of the server on which you installed Cruise Control.  You can download the CCTray tool from here.  After installing the tool, you can open the tray tool and set up which projects you would like it to monitor.

Adventure Works:

Adventure Works is the new Northwind.  While this is not a necessary install for the AWFF, it is used in the sample project for example's sake.  If you are going to run the sample application without changes, you'll need to install the AW database. 

Installation instructions and the download can be found here: Codeplex - SqlServerSamples

As a note, the sample makes use of the full standard AW database (not the Case Insensitive Versions or the Light versions or the warehousing versions)

 

 

  • Create a database (or use the AdventureWorks database)
  • At a command prompt (with admin access) run the ASP.NET SQL Server Registration Tool (ASPNET_REGSQL.exe).  The aspnet_regsql.exe file is located in the [drive:]\%windir%\Microsoft.NET\Framework\version folder on your machine.
  • Follow the wizard to register the database you created
  • Create new project from AWFF
  • In VS2008, on the menu, select "Project->ASP.NET Configuration" this will bring up the ASP.NET Web Site Administration tool.
  • Click on the Security Tab
  • Under the Roles menu, select "Enable Roles"
  • Now click on the "Create or Manage roles" link.
  • Create two new roles.  Admin and User
  • Go back to the Security Tab
  • Click on "Create User"
  • Create a user "Administrator", assigning both roles and making sure that he is Active.  Then click "Create User"
  • Click Continue
  • Go back to the Security Tab
  • Select "Manage Access Rules"
  • On the root folder, create a rule [All Users, Deny]
  • On the root folder, create a rule [Role: User, Allow]
  • On the Admin folder, create a rule [Role: Admin, Allow]
  • On the App_Themes folder, create a rule [Role: Anonymous, Allow]
  • Click on the Application Tab
  • Select "Configure SMTP e-mail settings"
  • Fill in settings and save.
  • Close the Web Site Admin tool
View Trenton Adams's LinkedIn profileView Trenton Adams's profile

Posted by trenton adams on Sunday, February 17, 2008 9:56 PM
Permalink | Comments (0) | Post RSSRSS comment feed

SQL Server 2005 Reporting Services on Vista x64

Recently I was working on a project that called for Reporting services, and I ran into a couple of annoying issues with using it on Vista (x64, not sure if it behaves similarly on x86 versions). 

 

The first issue I ran into was setting up the Reporting Services server with SQL Server Express 2005 Advanced and IIS 7.

 

Basically if you're trying to set up the Reporting server with Integrated security, don't.  It doesn't work.

You need to install SQL Server 2005 in mixed mode.  You'll need to create a SQL User for logging into the reporting services databases.  And when you configure reporting services for IIS 7, use this user for your SQL connection.   You can leave your .config files for the web site as user Impersonate, as long as that user has access to the reporting services directories.

 

 

The Second issue is with using the Report Viewer with Visual Studio 2008.  I don't know if this is an issue with other configurations, but I ran into it when I was using forms authentication.

 

You need to include a security exclusion for the ReportViewer, else VS 2008 will CRASH when trying to run a report.

 

Here is the Security config line I used.  Modify as needed.

<location path="Reserved.ReportViewerWebControl.axd">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

 

kick it on DotNetKicks.com


Posted by trenton adams on Sunday, January 27, 2008 6:38 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Web Application Foundation - Part 1 - Preparing a Continuous Integration Server

This is the first article in a series that I intend to be a step by step walkthrough of preparing for a new web project. 

  1. Part 1 is going to cover creating a continuous integration server using CruiseControl.NET, and assumes that you already have a server setup with Windows Server and a Visual Source Safe Server.
  2. Part 2 is going to cover setting up a client computer for running Visual Studio 2008 and integrating with CCNet and VSS
  3. Part 3 is going to cover creating a sample web application with a deployment project and having this project run in our continuous integration environment
  4. Part 4 will be adding the ASP.NET Membership Provider to our Web Application
  5. Part 5 is going to cover using MVP Architecture to be able to unit test our web application
  6. Part 6 will be using WiX to create a setup file
  7. Finally part 7 will go over various tools and applications that really go hand-in-hand with CI.  Tools will include FxCop, Simian, NCover, NDepend, and others.

We're going to start with a base install of Windows Server 2003 (2008 will work just fine as well), all all the latest updates from Microsoft. 

  • Create a user "CruiseControl" with local administrative rights
  • Make sure that IIS is installed and running.
  • Create a shared directory called "Builds", and another directory called "vssroot"
  • Install the .NET Frameworks v2.0, v3.0, and v3.5
  • Install WiX v3.0.3621 or greater
  • Install CruiseControl.NET v1.3
  • Optionally install CCNetConfig a tool to edit CruiseControl.NET configuration files with a GUI
  • Install the Visual Source Safe 2005 client utilities
  • Install Nant 0.85
  • Run services.msc
  • Open the properties of the "CruiseControl.NET Server" service
  • Set the Startup type to Automatic
  • Under the Log On tab, select Log on as the CruiseControl user you created

Configuring the VSS Database: (more on this later)

  • Create a new VSS Database
  • Add a read/write user by the name cruisecontrol 
  • The project should be layed out in the following manner:
    • $/
    •     trunk
    •         buildScript
    •             cruise.build
    •         source
    •             project.sln

Configuring the project in CruiseControl.NET

  • Open the CruiseControl.NET Config file located by default here:  C:\Program Files\CruiseControl.NET\server\ccnet.config
  • Insert the following project xml into the config file changing the fields in brackets to meet your needs: 

 

<project name="[MyProjectName]">
<sourcecontrol type="vss">
<project>$/trunk</project>
<username>cruisecontrol</username>
<password>[CruiseControlUserPassword]</password>
<executable>[path to visual source safe]\SS.EXE</executable>
<ssdir>[ Path to VSS database .ini file ]\</ssdir>
<autoGetSource>True</autoGetSource>
<applyLabel>False</applyLabel>
<workingDirectory>c:\vssroot\[MyProjectName]\</workingDirectory>
<cleanCopy>True</cleanCopy>
      </sourcecontrol>
<triggers>
            <intervalTrigger seconds="60" />
</triggers>
      <tasks>
            <nant>
                  <executable>C:\Program Files\nant-0.85\bin\NAnt.exe</executable>
                  <baseDirectory>C:\vssroot\[MyProjectName]</baseDirectory>               
                  <buildFile>C:\vssroot\[MyProjectName]\buildScript\cruise.build</buildFile>
                  <nologo>True</nologo>
                  <buildTimeoutSeconds>30</buildTimeoutSeconds>
                  <targetList>
<target>run</target>
                  </targetList>
            </nant>
</tasks>
</project>

 

  • All of the other scripts will be included in VSS and pulled automatically during a build.

 

[Added]

 

I had a couple questions about the proper way to install NAnt in our configuration.  Basically there are three items you need in order to have a successful installation.

  1. Unzip the NAnt-0.85 folder into your program files directory under c:\Program File\NAnt-0.85
  2. Unzip NAnt-Contrib into the NAnt installation directory.  The files will need to be in the following Locations:

    \
        bin\
            lib\
                net\
                    CollectionGen.dll
                    Interop.MsmMergeTypeLib.dll
                    Interop.StarTeam.dll
                    Interop.WindowsInstaller.dll
                    SourceSafe.Interop.dll

            tasks\
                net\
                    MSITaskErrors.mst
                    MSITaskTemplate.msi
                    MSMTaskErrors.mst
                    MSMTaskTemplate.msm
                    NAnt.Contrib.Tasks.dll
                    NAnt.Contrib.Tasks.pdb (not available for releases)
                    NAnt.Contrib.Tasks.xml

            SLiNgshoT.Core.dll
            SLiNgshoT.exe

    Note: you might have to manually create the "tasks\net" and "lib\net" directories. (taken from NAnt Contrib Readme file)

    3. Finally you'll need to modify the NAnt config file in order for it to handle working with VS2008, Palermo offers an excellent article on this:

    Jeffrey Palermo's Explaination of the NAnt Upgrade to 3.5

     


kick it on DotNetKicks.com

Posted by Trenton Adams on Friday, January 4, 2008 4:23 PM
Permalink | Comments (0) | Post RSSRSS comment feed