How to build NodeXL?

Mar 21, 2011 at 11:00 AM

Hi, I have to extend NodeXL library as Bachelor thesis. I downloaded source code (54290). When I click Rebuild solution, 33 errors appear in the error list. For example:

Error 11 Metadata file 'C:\Users\koj\Desktop\nodexl-54290 – kopie\NodeXL\Algorithms\bin\Debug\Microsoft.NodeXL.Algorithms.dll' could not be found Layouts

What I have to do to successful rebuild?

I have Windows 7 Professional SP1 (x64), Office Home and Student 2010 (both x86 and x64) and Visual Studio 2010 Professional (with Visual Studio Tools for Office Runtime).

I am beginner in this respect, so I will be glad of any advice.

Mar 21, 2011 at 5:11 PM

First, I assume that you are using the latest version of the source code, which as of today is version 1.0.1.162.  It's available on the Downloads tab at http://nodexl.codeplex.com/releases.

The source code is actually a Visual Studio 2008 solution.  When opened in Visual Studio 2010, the solution gets converted to Visual Studio 2010 format and something is going wrong during the conversion.  While I try to figure out what the problem is, I'll ask you whether your work involves the top-level Excel project or just the lower-level class library projects.  If you are not using Excel, then the quick workaround is to remove all projects from the solution except the following:

* Adapters
* Algorithms
* ApplicationUtil
* Core
* Layouts
* TestWpfNodeXLControl
* Util
* WpfControl
* WpfVisualization

You can remove a project by right-clicking it in Solution Explorer and selecting Remove.  As a side benefit, removing all the Excel-related projects will significantly speed up your builds.

-- Tony

 

Coordinator
May 6, 2011 at 2:22 PM

Hi,

 

Is there any way to successfully build NodeXL in Visual Studio 2010 without removing any project?

 

Thanks,

Arber

May 7, 2011 at 6:00 AM
Edited May 7, 2011 at 7:30 PM

For some reason, the Visual Studio 2010 project conversion wizard modifies (and breaks) some files that it shouldn't touch, namely the *.Designer.cs files in the ExcelTemplate project.  That's why you can't build the entire solution in 2010.  I don't know if there is a setting to prevent this, or if it's a bug in 2010, or what.

First, have you tried installing Visual Studio 2010 Service Pack 1 to see if that makes a difference in what the conversion wizard does?  It was released a few months ago.  I haven't installed it yet, so please let me know the results you get, whether good or bad.

If that doesn't work, here is what I did to get NodeXL to compile in Visual Studio 2010:

1. Make a copy of the original NodeXL\ExcelTemplate\*.Designer.cs files.  There are eight of them -- Sheet1.Designer.cs, Sheet2,Designer.cs, and so on.

2. Open NodeXL.sln in Visual Studio 2010, which starts the conversion wizard.

3. Let the conversion wizard run to completion.  It succeeds without complaint.

4. Overwrite the (badly converted) *.Designer.cs files with the copies you made in step 1.

5. Rebuild the solution.  You'll still get two errors.

6. Rebuild the solution again.  You'll get zero errors.  (Why the need for the second rebuild?  I don't know.)  There will still be a bunch of benign warnings having to do with some XML documentation mistakes that 2008 didn't catch for me.  I'll fix them in a future release.

Assuming this works for you, too, note that I have not tested the 2010-built solution very much.  As I mentioned, I do not yet use 2010 for this part of NodeXL, and I do not have much time to spend on 2010 at the moment.

-- Tony

May 7, 2011 at 7:30 PM

The XML documentation warnings I mentioned above will be fixed in version 1.0.1.168 of NodeXL.

-- Tony

Coordinator
May 9, 2011 at 12:21 PM

Thank you very much Tony, it worked!

 

But anyways in the end I get the following error:

Error    34    The command "(if not exist D:\NEO\PROGRAME\New Folder (2)\Tema Masterit\NodeXL(src)\NodeXL\ExcelTemplate\bin\Debug\PlugIns md D:\NEO\PROGRAME\New Folder (2)\Tema Masterit\NodeXL(src)\NodeXL\ExcelTemplate\bin\Debug\PlugIns) && copy D:\NEO\PROGRAME\New Folder (2)\Tema Masterit\NodeXL(src)\NodeXL\GraphDataProviders\bin\Debug\Microsoft.NodeXL.GraphDataProviders.dll D:\NEO\PROGRAME\New Folder (2)\Tema Masterit\NodeXL(src)\NodeXL\ExcelTemplate\bin\Debug\PlugIns" exited with code 255.    ExcelTemplate

In the post-build event there are two variables $(SolutionDir) and $(TargetDir), but here I see that they point to the same directory. I have also checked if this file exists in the folder and it does (I even tried to copy/paste it in Program Files given that TargetDir should point to the installation directory)

Is this a normal behavior?

Anyways the setup is created but when I try to install it I get the following error:

Error 1001: The installation of the ClickOnce solution failed with exit code -400

I don't know if this two errors are related.

May 9, 2011 at 11:32 PM

You are reporting two problems here.  First one first:

No, error 34 is NOT normal when building the ExcelTemplate project.  The post-build event is supposed to copy the GraphDataProviders DLL from NodeXL\GraphDataProviders\bin\Debug to NodeXL\ExcelTemplate\bin\Debug\PlugIns, after creating the PlugIns directory if necessary.  This works fine in both Visual Studio 2008 and 2010 on my computer.  I can't figure out how $(SolutionDir) and $(TargetDir) can point to the same directory on your computer.  $(SolutionDir) should point to NodeXL\ and $(TargetDir) should point to NodeXL\ExcelTemplate\bin\Debug\.  Do you have any idea how that can be?  What do they point to in the solution's other projects?

-- Tony

May 10, 2011 at 12:40 AM
Edited Sep 30, 2011 at 11:12 PM

Second one second:

I don't think this is related to the first error.

Exit code -400 from VSTOInstaller.exe means "The solution could not be installed," which of course is a useless error message:

http://msdn.microsoft.com/en-us/library/bb757423.aspx

You'll have to do some detective work.  Do the following:

1. Run your (defective) setup program.

2. When you get the error message with exit code -400, STOP.  Leave the error message on the screen.

3. In a command window, navigate to C:\Program Files (x86)\Common Files\microsoft shared\VSTO\9.0, or its equivalent on your computer.  If you have a 32-bit computer, the " (x86)" part won't be there.  If your computer uses a language other than English, part of the path will be in your language.

4. Run this command: VSTOInstaller.exe /I "C:\Program Files (x86)\Microsoft Research\Microsoft NodeXL Excel Template\Microsoft.NodeXL.ExcelTemplate.vsto".  (Again, your exact path may differ.)

5. You should get a popup error message from VSTOInstaller.exe.  What does it say?

What's happening here is that NodeXL's Setup.exe runs VSTOInstaller.exe silently, and when VSTOInstaller.exe fails with a useless error code like -400, the only way to find out the details is to run VSTOInstaller.exe again but NOT silently.  You have to do this while the error message in step 2 is still on the screen because once you say OK to the error message, the Setup.exe will roll back and remove all its files in the Program Files directory.

-- Tony

May 10, 2011 at 12:42 AM

By the way, are you running Visual Studio 2010 Service Pack 1?  I'm still wondering if that fixes any of the problems you're seeing on your computer.

-- Tony

Coordinator
Jun 14, 2011 at 1:40 PM

Hi Tony,

 

I tried this and I got a message saying "entryValue out of range" (something like that because I am not able to reproduce the same error again).

Then I read somewhere that this problem can be fixed by running VSTO 10.0 instead of VSTO 9.0 and I did that and it installed successfully. Now when I try to install the template with VSTO 9.0 I get another error saying:

The expected element "addIn" was not found in the XML.

************** Exception Text **************
Microsoft.VisualStudio.Tools.Applications.Deployment.InvalidManifestException: The expected element "addIn" was not found in the XML.
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ApplicationManifest.Load(XmlReader reader)
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ApplicationManifest.FromXml(String manifest)
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ApplicationManifest.FromXml(String manifest, Boolean validate)
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ApplicationManifest..ctor(String manifest, Boolean validate)
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

 

I read in the internet about this error and people say that Visual Studio 2010 target only the VSTO 2010 and cannot target VSTO 3.0. Can you tell me if I can change the targeted VSTO in NodeXL project in Visual Studio so it can target to VSTO 2010?

P.S. During installation the exit code that I get is not enymore 400 but 202.

 

Thank you in advance!

 

Arber

Jun 15, 2011 at 1:05 AM
Edited Jun 15, 2011 at 4:07 AM

Arber:

Are you saying that you were able to successfully build the entire solution, including the ExcelTemplateSetup project, but that you encountered a problem when attempting to run the Setup.exe file?

If that's the case, then don't use the ExcelTemplateSetup project to create your setup program.  That project, which is a Windows Installer/ClickOnce hybrid, is very complicated, because it has to satisfy several requirements in our project that you probably don't have in yours.  Instead, use the Publish tab on the Properties page for the ExcelTemplate to publish a simple ClickOnce installation.  The instructions for doing so are here:

http://msdn.microsoft.com/en-us/library/31kztyey.aspx

You will have to change the certificate used to sign the ClickOnce manifest before publication will succeed.  You can do that on the Signing tab of the Excel Template Properties page.

I think this will be much easier than trying to figure out what's wrong with the ExcelTemplateSetup project under Visual Studio 2010.  It works with Visual Studio 2008, but I have not yet tried it in 2010.

-- Tony

Coordinator
Jun 16, 2011 at 1:21 PM

Hi Tony,

First of all thanks for your reply!

Actually I downloaded the new version of NodeXL (1.0.1.170) and I was able to build the code without any error, even the problem with the Designer.cs files disappeared. However when I try to run Setup.exe I still get the same error. I don't really know what is happening because in the moment that this error appears and if I don't click the OK button which will revert the installation, I can practically see the application in Program Files and I can open the template and also the changes that I made in the code are reflected. So the application is somehow installed correctly, but I don't know what the error means.

I even tried the Publish... option that you suggested and the application is published successfully, but when I run the setup.exe it doesn't install the application like the normal setup (no folder is created in Program Files and no NodeXL template is available at the start menu). If I open the published NodeXL template I cannot see the GraphDataProviders (meaning I cannot get data from Twitter, Flickr etc) as the dll is not copied.

Actually I am downloading Visual Studio 2010 SP1 and I will give it a try and see if this will fix the problem. In such case I will notify you!

 

Thanks again!

Arber

Coordinator
Jun 16, 2011 at 3:09 PM

Hello again Tony,

I found this topic http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/42d3c7f0-c990-4c69-a0cc-a3ed91272557/ and I think this is the problem.

I will try to install NodeXL generated from my PC in another machine and see if it is runs OK. In that case I will continue like this and wait until NodeXL will be switched to Visual Studio 2010.

 

Arber

Jun 16, 2011 at 4:09 PM
Edited Jun 16, 2011 at 4:10 PM

Arber:

I didn't know that you needed to use the GraphDataProviders DLL.  That's one of the requirements I mentioned that complicate NodeXL's setup project.

When you use the Publish option, you are creating a ClickOnce setup that installs the solution in the user's ClickOnce cache.  ClickOnce does not put anything in the Program Files folder, and therefore there is no PlugIns subfolder into which the GraphDataProviders DLL can be placed.  It also does not put the NodeXLGraph.xltx template in a convenient location.

NodeXL's setup project uses a hybrid scheme where it does put everything in the Program Files folder, including the PlugIns subfolder, the GraphDataProviders DLL, and the template, and then runs a small program (ExcelTemplateSetupClickOnceInstaller) to install the solution in the ClickOnce cache.  There are several other complications (32-bit vs 64-bit targets, security requirements, etc.) that make the setup project way more complex than I would like.

-- Tony

Coordinator
Jun 16, 2011 at 4:52 PM
Edited Jun 16, 2011 at 4:58 PM

Tony,

Actually I am working with Marc on my Master Thesis and I will implement a Facebook data provider to directly get data from Facebook (like it is done with Twitter, Flickr etc) that's why I need the GraphDataProvider.dll.

Anyways it doesn't bother me to continue with this error and if the setup will run successfully on other machines (I have not yet tried) that's great, I don't mind at all.

By the way I have mentioned in a previous post that I also had problems with a post-build event. Actually the problem in this case was that the path of the solution folder contained "(" and space and this was preventing the project to build successfully. As soon as I changed this everything was OK (I moved the source code to a folder that had no "(" and spaces in the path). I mentioned this just for you to know if anyone else will have the same problem in the future.

 

Arber

Jun 16, 2011 at 6:01 PM
Edited Jun 16, 2011 at 6:03 PM

Arber:

If you are just developing a new GraphDataProvider DLL and you are not customizing anything in the ExcelTemplate project, then you do not need to build the ExcelTemplateSetup project.  In fact, you don't need to build the NodeXL source code at all.  In fact, you don't even need to download the NodeXL source code!  None of that is necessary, and it just gets in the way of your task.

Instead, this is how I recommend you develop your custom GraphDataProvider:

1. Create a new Visual Studio solution (2008 or 2010) and a Class Libraries project.  The Class Libraries project will build your custom GraphDataProvider DLL.

2. Target the Class Libraries project to the .NET Framework 3.5, and add a reference to Microsoft.NodeXL.ExcelTemplatePlugIns.dll.  The ExcelTemplatePlugIns DLL is the only thing you need from NodeXL.

3. Create a Windows Forms project in the solution that tests the Class Libraries project by calling your IGraphDataProvider.TryGetGraphData() method.  The nature of the test project is entirely up to you.  In my own TestGraphDataProviders project, I populate a WebBrowser control with the returned GraphML.

4. Implement your DLL, testing it along the way with your test project.  The implementation/test process does not involve Excel at all.

5. When your DLL is implemented and tested, perform final testing with Excel.  Install NodeXL on some computer using the standard NodeXL Setup.exe downloaded from CodePlex site, and manually copy your GraphDataProvider DLL into the PlugIns folder.

I believe you will be distributing only your own DLL, not NodeXL itself.  Therefore, you do not need to struggle with NodeXL’s setup program, or with building NodeXL at all.

-- Tony

 

Jun 16, 2011 at 7:30 PM
Edited Jun 16, 2011 at 7:30 PM

(In version 1.0.1.172, I have updated the IGraphDataProvider topic in the NodeXLApi.chm help file with my notes above.  The topic did not give enough details before.  I have also updated "For Programmers: About NodeXL Graph Data Providers" at http://nodexl.codeplex.com/discussions/71182.)

-- Tony

Coordinator
Jun 16, 2011 at 8:26 PM

Thanks Tony!

This is really useful, but I have also to implement a community detection algorithm for overlapping communities (the k-clique percolation method). As far as I have seen it is implemented in the SNAP library that NodeXL uses, but still I have to make some changes in the Algorithms project and maybe also in the ribbon menu of NodeXL. So I need the source code of NodeXL (correct me if I am wrong because I haven't watched the source code thoroughly).

Arber

Jun 17, 2011 at 5:38 AM

You will indeed need the source code for that.

-- Tony

Dec 15, 2011 at 3:56 PM

The steps that are required to convert the NodeXL solution to Visual Studio 2010 format are now included in the release notes for the source code download on CodePlex.  The source code download can be found on the CodePlex Downloads tab at http://nodexl.codeplex.com/releases.

-- Tony