Building BuzzGUI

Post Reply
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Building BuzzGUI

Post by IXix »

I can't build BuzzGUI anymore. The BuzzGUI.MachineView project wouldn't load because of some dependencies related to "Fody". I found Fody on GitHub but I can't figure out how to install it properly to get the project to build. What do I need to do? :?:
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Building BuzzGUI

Post by oskari »

Install the NuGet package manager extension for VS. I think it should automatically get the Fody package then.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

oskari wrote:Install the NuGet package manager extension for VS. I think it should automatically get the Fody package then.
No, the project still won't load. It gives these errors...
BuzzGUI\BuzzGUI.MachineView\BuzzGUI.MachineView.csproj : error : Unable to read the project file 'BuzzGUI.MachineView.csproj'.
BuzzGUI.MachineView\BuzzGUI.MachineView.csproj(388,3): The imported project "C:\...BuzzGUI\BuzzGUI.MachineView\Fody.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I can see in the NuGet settings that it's supposed to try to install missing packages during the build process but VS won't load the project so I can't try to build it.
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Building BuzzGUI

Post by oskari »

Some files were filtered out from the svn repo, they are there now.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

oskari wrote:Some files were filtered out from the svn repo, they are there now.
Great! Now it loads but it won't build. It seems to have installed Fody but now I'm getting lots of these three errors...
The type or namespace name 'PropertyChanged' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DoNotNotify' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DoNotNotifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
I'm guessing they all stem from this line which is marked as an error...

Code: Select all

using PropertyChanged
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Building BuzzGUI

Post by oskari »

Right click the project -> Manage NuGet Packages -> Installed packages should have PropertyChanged.Fody. Is it there?
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

oskari wrote:Right click the project -> Manage NuGet Packages -> Installed packages should have PropertyChanged.Fody. Is it there?
No, there are no packages listed. I must have been mistaken about it installing Fody. I also noticed that it's complaining about 'Newtonsoft.Json' being missing too.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

Making progress. I managed to install "Fody", "PropertyChanged.Fody" and "Json.NET" into the machine view project via the package manager, which has gotten rid of all the previous errors but it still doesn't build. Now I get just one error which is...
The "Fody.WeavingTask" task could not be loaded from the assembly C:\...\BuzzGUI\BuzzGUI.MachineView\\Fody.dll. Could not load file or assembly 'file:///C:\...\BuzzGUI\BuzzGUI.MachineView\Fody.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask"
There's no Fody.dll in the path so I need to figure out why it's not there, or perhaps find where it is (if it exists) and modify the <UsingTask> declaration.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

There's a Fody.dll in "BuzzGUI\packages\Fody.1.25.0" so I guess I can modify the <UsingTask> (wherever that is!) to look in the right place?
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

Found this in the "fody.targets" file...

Code: Select all

<UsingTask
      TaskName="Fody.WeavingTask"
      AssemblyFile="$(FodyPath)\Fody.dll" />
so it looks like $(FodyPath) is wrong. I can probably sort that manually but I'd like to understand why it's wrong.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

IXix wrote:I can probably sort that manually
I take that back. I can't sort it.

Tried copying fody.dll into the project path but that just gives a different error so I deleted the copy.
The "Fody.WeavingTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
Any idea what I need to do? I haven't got a clue. :(
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Building BuzzGUI

Post by oskari »

I don't know what it is either. Can someone else try this? I only have one vs installation and I don't want to fuck it up.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Building BuzzGUI

Post by UNZ »

The "Fody.WeavingTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
same here. fixed all the other problems, but stuck on this one. tried to install from nuget, but doesn't help.
snowglobe
Posts: 356
Joined: Wed Nov 23, 2011 12:36 pm

Re: Building BuzzGUI

Post by snowglobe »

inelegant workaround:

copy contents of buzzgui\packages\Fody.1.26.0-beta0001 to buzzgui\Fody
edit buzzgui\BuzzGUI.MachineView\Fody.targets changing AssemblyFile="$(FodyPath)\Fody.dll" to AssemblyFile="$(SolutionDir)Fody\Fody.dll"

Edit: oh, right, mine is "Fody.1.26.0-beta0001" because I tried the pre-release and haven't figured out how to roll back to 1.25

Edit2: the crux of the problem is that [Fody.targets]<FodyPath = $(MSBuildThisFileDirectory)> sets the FodyPath to buzzgui\BuzzGUI.MachineView\ instead of buzzgui\packages\Fody-whatever-version\
Last edited by snowglobe on Thu Oct 23, 2014 11:15 pm, edited 1 time in total.
User avatar
mantratronic
Posts: 296
Joined: Mon Nov 21, 2011 7:23 pm

Re: Building BuzzGUI

Post by mantratronic »

thanks!

i needed to restart visual studio to get it to work after editting the file.

edit: and i was using 1.25
snowglobe
Posts: 356
Joined: Wed Nov 23, 2011 12:36 pm

Re: Building BuzzGUI

Post by snowglobe »

As per unz, $(SolutionDir)packages\<Fody folder>\Fody.dll also works and eliminates the need to duplicate the folder contents.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

I'm still confused. What do I have to do to get it working? :?:
User avatar
mantratronic
Posts: 296
Joined: Mon Nov 21, 2011 7:23 pm

Re: Building BuzzGUI

Post by mantratronic »

create a new directory in the solution folder called "Fody", move the contents of the current directory buzzgui\packages\Fody.1.YourVersionHere into it, and they edit the project's Fody.targets file from AssemblyFile="$(FodyPath)\Fody.dll" to AssemblyFile="$(SolutionDir)Fody\Fody.dll" , restart VS
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Building BuzzGUI

Post by IXix »

Okay, I think I've nailed this without having to edit or copy anything. It looks like it's some kind of Fody version conflict because if I install an older version (the one that seems to be referenced) then it works okay and the project builds.

If you've already installed Fody and PropertyChanged.Fody then uninstall them both from the NuGet Package Manager.

Now select "Tools/NuGet Package Manager/Package Manager Console" from the VS menu and in the console that opens type the following...

Code: Select all

Install-Package Fody 1.13.8 -ProjectName BuzzGUI.MachineView
It will ask to overwrite the existing files "Fody.targets" and "FodyWeavers.xml". Answer yes to both and you should see...

Code: Select all

Successfully added 'Fody 1.13.8.0' to BuzzGUI.MachineView.
Now type...

Code: Select all

Install-Package PropertyChanged.Fody -ProjectName BuzzGUI.MachineView
...watch some status gibberish and then try building the project. Hopefully it will now work. :)
Post Reply