Page 1 of 1

Building BuzzGUI

Posted: Wed Oct 22, 2014 12:50 pm
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? :?:

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 1:05 pm
by oskari
Install the NuGet package manager extension for VS. I think it should automatically get the Fody package then.

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 1:44 pm
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.

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 1:48 pm
by oskari
Some files were filtered out from the svn repo, they are there now.

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 3:11 pm
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

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 3:36 pm
by oskari
Right click the project -> Manage NuGet Packages -> Installed packages should have PropertyChanged.Fody. Is it there?

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 5:09 pm
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.

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 6:08 pm
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.

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 6:13 pm
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?

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 6:19 pm
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.

Re: Building BuzzGUI

Posted: Wed Oct 22, 2014 7:08 pm
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. :(

Re: Building BuzzGUI

Posted: Thu Oct 23, 2014 12:33 pm
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.

Re: Building BuzzGUI

Posted: Thu Oct 23, 2014 6:17 pm
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.

Re: Building BuzzGUI

Posted: Thu Oct 23, 2014 10:19 pm
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\

Re: Building BuzzGUI

Posted: Thu Oct 23, 2014 10:27 pm
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

Re: Building BuzzGUI

Posted: Thu Oct 23, 2014 10:42 pm
by snowglobe
As per unz, $(SolutionDir)packages\<Fody folder>\Fody.dll also works and eliminates the need to duplicate the folder contents.

Re: Building BuzzGUI

Posted: Fri Oct 24, 2014 8:06 pm
by IXix
I'm still confused. What do I have to do to get it working? :?:

Re: Building BuzzGUI

Posted: Fri Oct 24, 2014 8:32 pm
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

Re: Building BuzzGUI

Posted: Sat Oct 25, 2014 7:30 pm
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. :)