1

I have an MVC project that has been working for years that I just re-published to the server yesterday. I opened it up to debug and make changes to code. Some time in between compiles, something happened and now the build fails complaining that

The type 'System.Windows.FrameworkElement' is defined in an assembly that is not referenced. You must add a reference to assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

and

The type 'System.Windows.DependencyObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

I have looked at similar questions and done as they have suggested to make sure all files are set to the Build Action compile, content or none for the project. I didn't add any new files and I didn't copy paste any images into solution.

Any ideas?

Edit:

Not sure if this will be helpful. I didn't include it because it doesn't seem like it would be, but this is where it takes me when I double click on the errors given.

    public PartialViewResult GetByJobID(int jobID)
    {
        ViewBag.Jobid = jobID;
        var getAllHolesByJobID = _toolCalloutService.getAllJobHoles(jobID);
        var toolOrderHoleViewModels = //error happens here on var
            getAllHolesByJobID.Select(Mapper.Map<HoleInfoViewModel, ToolOrderHoleViewModel>).ToList();
        var shipOrigins = _toolCalloutService.GetDistricts();
        ViewData["ToolOrderHoleViewModels"] = toolOrderHoleViewModels;
        ViewData["ShipOrigins"] = shipOrigins;
        ViewData["OrderedBy"] = System.Web.HttpContext.Current.User.Identity.Name.Substring(9);
        return PartialView("~/Views/ToolCallout/ToolCallout.cshtml");
    }

It just highlights the var keyword at var toolOrderHoleViewModels.

user3738893
  • 425
  • 1
  • 6
  • 18
  • 3
    We can't answer the question _"What happened?"_. Compare your local version against Source Control to see the changes. You most likely made a typo and Alt+Entered that to let ReSharper import a WPF assembly, which you don't want for a web application. If you don't have source control, let this be a lesson to start using it. If you want help on solving the issue, you need to show the relevant code that causes these compiler errors. – CodeCaster Dec 12 '14 at 15:57
  • 4
    Why do you need System.Windows.FrameworkElement in an MVC site? – L-Four Dec 12 '14 at 15:58
  • 1
    Thats what i thought... thats WPF – Florian Schmidinger Dec 12 '14 at 15:59
  • 1
    That's exactly the problem. I don't need or want WPF anything. I discarded all changes from source control, but the change is in the dll. I was hoping someone might have something I can try to fix it. – user3738893 Dec 12 '14 at 16:04
  • 1
    Regarding your edit: it seems like either `HoleInfoViewModel` or `ToolOrderHoleViewModel` (i.e. the one the mapper maps to, so I guess the latter) uses dependency properties. Did those classes get any edits lately? – CodeCaster Dec 12 '14 at 16:22
  • No those files are unchanged. If it were that I accidentally imported a WPF assembly, would there be any way to weed it out? – user3738893 Dec 12 '14 at 16:34

0 Answers0