5

I have a really weird problem with my Solution in VS2012.

The thing is, its a solution made by another person, and I have to use it for my c# course. I know it runs fine, because there are 3 others in my team, who got no warnings or anything like it.

From my point of view, the program runs just fine, but when I build, and search through the xaml files the errors just keep stacking up, about missing items in namespaces and other stuff like that:

Error 1 Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. C:\Users\jesperplantener\Documents\Visual Studio 2012\Projects\02350Demo.VS2012 (1)\02350Demo.VS2012\02350Demo\View\App.xaml 9 9 02350Demo

Error 2 The name "EventTrigger" does not exist in the namespace "clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity". C:\Users\jesperplantener\Documents\Visual Studio 2012\Projects\02350Demo.VS2012 (1)\02350Demo.VS2012\02350Demo\View\NodeUserControl.xaml 68 17 02350Demo

and so on, I got around 29 of those errors.

Now to the fun part:

I am running on a macbook air 2013. Windows virtually installed in Parallels. I expected this to be the flaw at first, so I reinstalled a Windows 7. That did not fix it. Then I upgraded my parallels installation from 8 to 9. Did not fix the problem. I just finished installing Windows 8 now, in parallels 9, and the problem is still there!!!

Please, can somebody help me before I do something stupid! :D

And btw, yes the project has been downloaded several times, and it Works on my teammates computers.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
Jesper Plantener
  • 229
  • 3
  • 16
  • maybe your teammates have installed some libraries that you dont. check and compare the BIN folders of your teammates to your too look for missing DLLs that they have but you dont – Mauricio Gracia Gutierrez Sep 12 '13 at 18:44
  • I could have specified that. All of us has got the exact same project files. Most of them have just installed visual studio, so they got a clean installation, just as I do. – Jesper Plantener Sep 12 '13 at 18:48
  • TFS + VS is not so good about keeping the REFERENCES in different computers. Do you have any REFERENCE with a YELLOS ADMIRATION MARK ? if that is the case remove and readd the reference – Mauricio Gracia Gutierrez Sep 12 '13 at 18:59
  • All the errors at the moment are something like this: Error1: The name "Interaction" does not exist in the namespace "clr-namespace:System.Windows.Interactivity;assem... Just concerning different names and different namespaces. – Jesper Plantener Sep 13 '13 at 05:57
  • Does the error still appear if you run VS in safe mode? (/SafeMode on command line). – FarmerBob Sep 13 '13 at 06:06
  • If I open VS is safe mode, I cannot open a single xaml file, it just comes with an environment error :( – Jesper Plantener Sep 13 '13 at 06:53

3 Answers3

2

Windows interactivity if I recall can have an optional blend assembly. Version 1 of Visual Studio 2012 version of Blend only worked in Win 8 and would not do WPF applications. You may not have the WPF version.

One can determine if the application version of blend is installed by running Blend. If it is and it works blend will come up normally, if not it will tell you and provide a link to download the trial version WPF version of Blend. This may have changed in the updates...

So before you anything, install update 3 to visual studio and then try blend. Verify it runs and then if you did install the update try a rebuild.

----- Update ----

For Microsoft.Practices.Services Locator, install from codeplex (Common Service Locator library)

----Update From OP (Jesper) ---

Verify all packages match same versions of .Net. Use Nuget to install/uninstall packages til all are aligned.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
  • @JesperPlantener Let us try to get one thing fixed first then...see update. – ΩmegaMan Sep 12 '13 at 23:18
  • Hi OmegaMan. Just tried updating to update 3. I thought I had it yesterday, but realised that I didn't just now. That only resulted in the xaml editor crashing every time I build the program. I'm doing a repair of VS now, to see if that fixes my problem, will return with the answer – Jesper Plantener Sep 13 '13 at 06:22
  • Nevermind, the repair did not solve the problem. Sometimes the designer Works, sometimes not. I just tried adding the downloaded Microsoft.Practices.Services Locator, but that did not Work either, same problem. In Blend everything seems to Work fine, I can open the project there, and it shows the different views just fine. – Jesper Plantener Sep 13 '13 at 06:57
  • Just googled the designer issue, which is related to something called xdesproc.exe.. Seems like that is another issue in Update 3, so the problems might not be related – Jesper Plantener Sep 13 '13 at 07:04
  • This is weird. Right now, all of the errors that are present are regarding mvvmlight: Error 1 The name "EventToCommand" does not exist in the namespace "clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4". C:\Users\jesperplantener\Desktop\02350Demo.VS2012\02350Demo\View\NodeUserControl.xaml 69 21 02350Demo – Jesper Plantener Sep 13 '13 at 07:08
  • Well.. And now some more errors are back.. An error related to the service locator is back. Right now 13 errors.. The weird thing is that I can open the project, build it and no errors. Then I open the xaml files and the errors start popping up.. – Jesper Plantener Sep 13 '13 at 07:14
  • Hey, important update! :) I just spoke with some other friends and some of them seem to have the same problem as I do.. Right now I am sitting beside two of my friends, and had them run it. One of them got the problem, the other one did not.. Now this is starting to get really weird I think! – Jesper Plantener Sep 13 '13 at 07:23
  • @JesperPlantener I have run into the situation the designer reports errors in Xaml (unfounded) but the project builds. Sadly that is a somewhat normal occurrence due to the fact that the Xaml is parsed outside the C# realm of things and the xaml *designer* parser is frankly as not as robust as the C# compiler. :-) – ΩmegaMan Sep 13 '13 at 13:30
  • Is there anything at all I can do then..? I mean its a pain in the ass that I cannot use the designer. – Jesper Plantener Sep 13 '13 at 18:21
  • @JesperPlantener One of the components, probably the MVVM light is causing the issues and its one you will have to live with on this project. Note, that even though there is a bit of a learning curve, the designer (not xaml hand editor) in Blend is actually better than VS and VS has a subset of the blend designer. There is no shame ( ;-) ) in working with both Blend/VS (I do it when I need the power of Blend). HTH – ΩmegaMan Sep 13 '13 at 20:24
  • 1
    I solved it! Uninstalled the mvvm light NuGet package, and reinstalled it, which gave me a version made for .net 4.5 instead of 4. Updated all references in the xaml, and downloaded a new .dll for the System.Windows.Interactivity to support 4.5 (old one was 4.0). This seems to have removed all errors! Thank you for your time OmegaMan! – Jesper Plantener Sep 14 '13 at 08:31
  • @JesperPlantener Glad to have helped at least lubricate the process. In a way maybe this was a better learning experience than the actual project. Insights which you learned from this debugging experience will serve you well going forward. – ΩmegaMan Sep 14 '13 at 14:26
0

Try download the assembly from http://scsf2012.codeplex.com/Download/AttachmentDownload.ashx?ProjectName=scsf2012&WorkItemId=1&FileAttachmentId=630895 (the link can be found at http://scsf2012.codeplex.com/workitem/1 ).

PS: just copied error message to google.

Ademar
  • 1,418
  • 1
  • 17
  • 27
  • Just tried it. Did not Work. Just said it is already part of the references.. Also tried deleting the old one, and using that one, did not Work. Here is a SS of the errorlist: http://i93.photobucket.com/albums/l47/sonsora_2006/Untitled-2.png – Jesper Plantener Sep 12 '13 at 19:01
  • Ok, then try that yet - http://stackoverflow.com/questions/8360209/how-to-add-system-windows-interactivity-to-project – Ademar Sep 13 '13 at 05:58
  • The thing is that the System.Windows.Interactivity is working and all, the program compiles just fine. Its only the designer that does not work, since it complains about missing references. – Jesper Plantener Sep 13 '13 at 06:13
0

I had a similar issue in Blend. The VS 2012 designer was fine, but received the same errors as you in Blend, preventing me to use Blend's designer.

To solve this, I removed the offending reference, and re added it; but I didn't use the "Add Project Reference...", instead I used the "Add Reference" and selected the DLL manually from the file-dialog box.