Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6472033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:17:40+00:00 2026-05-25T06:17:40+00:00

I’m a using the repository pattern and Unity to manage the dependency to my

  • 0

I’m a using the repository pattern and Unity to manage the dependency to my concrete repository objects. In itself this is not an issue however I am running into a problem when using publish website in both VS and the TFS build process.

I believe the problem is being caused by the fact that although the project which contains the concrete repository objects is referenced in my application, the classes that it contains are never used directly. This is because I am using Unity to create instances of the concrete objects at runtime using the Unity config held in my web.config.

The repository project is being compiled when and included in the output when built but when publish website is used in either VS of TFS the repository assembly is missing. Therefore when the web application is deployed to the web server it is not possible to use it as you are greeted with the error:

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

This is because Unity cannot find the missing assembly as you would expect.

So my specific question is; Is there a way to ensure that repository assembly is copied to the output directly when publishing the website in VS and TFS without directly using one of the concrete classes in the project?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:17:41+00:00Added an answer on May 25, 2026 at 6:17 am

    So with some digging around I have found a solution to my problem. This soltuion only fixes the problm when building with TFS but to be honest with continuos integration I’m not bothered about publishing from VS.

    My inspiration came from an answer given by Mike Hadlow

    What's the best way to get TFS to output each project to its own directory?

    Basically the solution is to modify the build script for web project so that it copies the missing assembly to the publish website output folder.

    Here is what I did:

    1. I right clicked on my web project in the solution explorer and clicked ‘Unload Project’.
    2. I then right clicked on the unloaded project and clicked ‘Edit [Project Name]‘
    3. Scrolling right down to the bottom of the file I found the following commented out build target:

      <Target Name=”AfterBuild”>
      </Target>

    4. I modified this adding the command to copy the missing assembly:

      <Target Name=”AfterBuild”>

      <Copy SourceFiles=”$(OutDir)[Missing Assembly Name]” DestinationFolder=”$(OutDir)_PublishedWebsites\$(MSBuildProjectName)\bin” SkipUnchangedFiles=”true” />

      </Target>

    5. Now when building the solution in TFS the missing assembly is included in the bin folder of the published website output.

    This solution could be used to copy any other missing content to the published website output. As the files that you want to copy are likely to be different for each project doing it in this way is probably the best option. I am however thinking about creating a custom version of Microsoft.WebApplication.targets which copies minified CSS and script files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.