David Yardy PE, MCSD.NET

just give me the source...

July 2008 Entries

Ever have trouble getting content for web projects.  Pepi Ronalds wrote up a very nice article describing the pains related to getting content (type) for web related projects.  Check it out here.

I came across this site this afternoon.  A number of beautiful photos by Harmad Darwish.  Harmad was hired by Microsoft to work on wallpaper collections for Vista.

image

category: Vista

In fact Microsoft has provided 101 of them.  How much do you wanna bet they are missing the one you are looking for?  (always 1 short).  Check it out here on MSDN

category: Linq

Credit goes to the Cincinnati SQL Server User’s Group/Phil Japikse for the following tip.  Two things of interest in this post.  Ability to create Sql Templates within SQL Server Management Studio and SQL to find objects named like ‘%here%’ across all objects in a database.


USE <databasename,string,@p1>
GO
SELECT OBJECT_NAME(OBJECT_ID)
FROM sys.sql_modules
WHERE definition like '%<string_to_find,string,@p2>%'
 

Now that you have the SQL it is possible to create a SQL Template (View – SQL Templates) whereby you can simply select and push Ctrl-Shift-M for variable substitution.  Within the Template Window create a new folder to store your custom templates, create a new template, paste the above SQL and Save.  To use simply click on the template and Ctrl-Shift-M to be prompted for the variables and values.

Great stuff.  Thanks guys for the tip.

category: SQL Server

Other Resources

category: SubText

Keep the following in mind with 2.0 Asp.net applications

  • Visual Studio 2005/2008 knows nothing about compiling a web application.  Visual Studio lets the asp.net platform perform the compilation.
  • When you perform a VS.NET Build > VS.NET does not build the application, Asp.net performs the build build of all the .cs and .vb files.  The resulting assemblies are placed by default in the C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files directory.
  • The debug setting in the web.config (debug/release) controls the compilation mode.  If in debug mode then respective .pdb debugging symbol files are created.
  • The Configuration Manager in the default build model of Visual Studio is not utilized.  As a result the only option for a web site ‘project’ is the Debug compilation.  This is because the web.config controls the compilation.
  • The Publish command will precompile the web application and place the files in a directory for deployment.  The Publish command executes the command line aspnet_compiler tool with the appropriate switches.  Publish will always precompile a release build without debugging symbols (pdb files)
  • Note: the Publish command does not change the debug setting in the web.config.  The Publish command always compiles in release ode however if you precompile to an updateable web site and then update the web site in place those dynamic compilations will produce debug code and pdb files.

Using the Web Site Deployment Utility (WSD)

Using WSD the above scenario is different.  Web Site Deployment project is really a nice interface on a MSBuild project.  The deployment project creates a MSBuild file and passes it to aspnet_compiler for compilation.  Unlike the VS.NET Publish the WSD will update the web.config for the right compilation mode.  The user controls the compilation mode within the Configuration Manager when using the Web Site Deployment project.

Setting up Configuration Manager as follows will deploy the files to the directory highlighted below without debug symbols (debug=false).  By setting up the configuration as follows makes it easy to prepare for deployment.  Simply change the configuration mode and hit build.  As shown below it will simply prepare the application for build and asp_compiler will deploy to the selected directory. 

In addition to controlling the debug mode WSD is great for swapping out appsettings for different environments (i.e. stage/test/production) respective for each build.


 image 

Control the deployed directory via Properties of the WSD project.

image


By debug mode will look like the following.  Notice that I am not building the WSD project in this mode

image

More information and features of Web Site Deployment Project can be found here.

 

Additional Configuration of the MSBuild file

By selecting the deploy project in the Solution Explorer and selecting open you can add additional MSBuild commands to the xml document.  I often add the following so that only the most appropriate files are included in the Release directory.

<ItemGroup>
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.vshost.exe" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.sln" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.csproj" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.user" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*Copy of*" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.psd" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.cmd" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\obj\**\*.*" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.Publish.xml" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\test\**\*.*" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.aspx.resx" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.asax.resx" />
      <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.suo" />
  </ItemGroup>

 
 
    <Target Name="AfterBuild">
        <Delete Files="$(OutputPath)\PrecompiledApp.config"></Delete>
    </Target>
category: Asp.Net

Yes, this is a new blog engine that I am taking for a test drive.  I tried BlogEngine.net for a few weeks but found just too many things that were causing problems and very little support for the problems I was having.  BE is currently at version 1.4.   I really like the ‘templating’ features of that engine and there are quite a few extensions already developed.  I think BE will grow to be very mature product but at this time just too many problems.

I really wanted a stable blog engine at this point.  Subtext setup was very easy and so far has been rock solid.  Good job with this.

 

My old blog at http://dyardy.spaces.live.com/ still lives for the time being as I make the transition.  Spaces is a great product but the time was right to get my blog back on my domain.  I have been using Spaces for 2.5 years and so I have many posts still on that engine.

Please update your RSS feeds to http://feeds.feedburner.com/davidyardy

category: SubText