Archive for the ‘visual studio’ Category

Vista doesn’t trust me!

August 20, 2008

I finally made the leap to Vista, which in truth was more down to my laptop requiring a complete overhaul than my desire to keep up with the Jones’s 😉

After the hours of installs, service packs and updates I was up and running and ready to dev again.

I recently downloaded some code to play around with and on extracting the zip file, opening Visual Studio 2008 and attempting the run the unit tests I got this error:

Test Run deployment issue.  File or location … isn’t trusted

…and all of my unit tests failed to execute.

I searched the web and finally found out that Vista had blocked the zip file I downloaded and subsequently the files extracted from it (strangely though…not all of them).

This issue is easily overcome by clicking the Unblock button under right click -> properties for each offending file.

File Properties Unblock

NOTE: The screenshot here is of my actual solution file which I have not unblocked as it does not seem to cause a problem.

If you have a load of files you need to unblock then look here.

Resources

Unit Test Trust Issue on Vista

Tips: Streams, Zones, Vista and Blocked Files in IE

Customising your ClickOnce deployment

March 24, 2008

Here are some tips which came in handy for me when I was creating my first ClickOnce deployment in Visual Studio 2008.

Deploying custom file(s)

If you have some custom file(s) which are required by your application then you can simply add them into your project as you would normally and change the properties to make sure they are deployed with ClickOnce.

  1. Add required file(s) to you project
  2. Change the Build Action property to Content
    FileProperties
  3. The file will now appear under Project Properties -> Publish -> Application Files
    ApplicationFileInVS2008

Creating custom prerequisites

If you have some prerequisites in the form of setup files or msi’s then you may want to install them as part of your ClickOnce deployment. For this you will need to download the Bootstrapper Manifest Generator application which funnily enough is now installed via ClickOnce. This application allows you to create custom packages (or bootstrappers) with the necessary XML manifest files to use with ClickOnce (or Windows installer) projects.

  1. Start the Bootstrap Manifest Generator application and create a new Package Manifest project
    NewPackageManifest
  2. Enter a project name and then add an install file
    AddCustomEXE
  3. Enter a display name for the package. At this point you can also define system checks, install conditions and many more options which I will look into another day 😉
  4. For VS 2008 you need to update the Project -> Properties (F4) to change the build location of the package.
    Project properties
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\<PackageName>
  5. Now build the package to ensure there are no warnings or errors.
  6. The package will now appear under Project Properties -> Publish -> Prerequisites
    PreRequisiteInVS2008

Resources