This project is read-only.

MSE - Can't Build

Topics: For MSE Developers
Aug 15, 2006 at 5:59 PM
migrated from power toy forums
originally posted by Vince P - http://forums.microsoft.com/MSDN/User/Profile.aspx?UserID=4090&SiteID=1
-------------------------------------------------------

When I try to build this project I get two errors

Error 1
"nunit.framework.dll" could not be found; NUnitDir must be set to a valid path in MSE.Settings.targets.
mseTest

Error 2
"nunit.framework.dll" could not be found; NUnitDir must be set to a valid path in MSE.Settings.targets.
MSE

I installed nunit 2.2.7 and confirmed that nunit.framework.dll is in this folder:

C:\Program Files\NUnit-Net-2.0 2.2.7\bin

In my MSE.Settings.targets I put the path in the proper place but the error doesn't go away. (The mseTest project does have the proper reference to this assembly too)

Excerpt of targets file:

<!-- Unit tests for MSE are developed and run using NUnit 2.2.7, which is available at http://www.nunit.org -->
<NUnitDir>"C:\Program Files\NUnit-Net-2.0 2.2.7\bin\"</NUnitDir>
<ErrorText Condition=" !Exists('$(NUnitDir)nunit.framework.dll') ">
"$(NUnitDir)nunit.framework.dll" could not be found; NUnitDir must be set to a valid path in MSE.Settings.targets.
</ErrorText>
Aug 15, 2006 at 6:44 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

You shouldn't have quotes surrounding the path (even if there's a space); try removing them.
Aug 15, 2006 at 6:46 PM
originally posted by Vince P
-------------------------------------------------------

tried without quotes and that didn't work either.

There's another section in the targets for ILMerge. That works only if I used quotes. If left the quotes out I get the same error I got with nunit.
Aug 15, 2006 at 6:48 PM
originally posted by Craig Lichtenstein - MSFT
-------------------------------------------------------

I've tried reproducing your problem but haven't had any luck thus far. I still don't need quotes around the NUnit or ILMerge paths and MSBuild has no problem finding the paths. I also tried moving my NUnit directory to C:\Program Files\NUnit-Net-2.0 2.2.7\bin to see if the dashes and dots were causing an issue but that worked as well. Some suggestions:

- Although you've probably done this, I'd confirm that nunit.framework.dll is actually in that directory since that's what Exists() is looking for.

- Is it possible that an additional <NUnitDir> tag was added somewhere and that's messing things up?

- Have you tried re-downloading the sources? Maybe the download was corrupted in some way (admittedly a long shot but easy to try).

Also, it would help if you could post the diagnostic output of the build attempt. This can be done by adding '/v:diag' to the end of the MSBuild command line and running the build again. The /v switch controls the verbosity of build output that's generated by MSBuild and 'diag' produces diagnostic output.
Aug 15, 2006 at 6:49 PM
originally posted by Craig Lichtenstein - MSFT
-------------------------------------------------------

Another thing to try is downloading one of our other tools, like MSBee, and seeing if you experience the same problem.
Aug 15, 2006 at 6:54 PM
originally posted by Vince P
-------------------------------------------------------

I dont know if this matters but I was doing the build within Visual Studio 2005.

Should I be doing it at the command line?
Aug 15, 2006 at 6:55 PM
originally posted by Vince P
-------------------------------------------------------

Apparently it did matter, when I ran MSBuild at the command line the compiliation worked.

Why wont it work inside VS?
Aug 15, 2006 at 6:57 PM
originally posted by Vince P
-------------------------------------------------------

I was looking at Sara's answer to another person's problem and she recommended to close and reopen the solution. I hadn't done that when I made changes to targets (didn't know I had to). So I have now closed and reopened the solution and was able to build the solution. I guess the targets file is only read at the time the solution is open and so any changes to it are not noted unless the solution is reopened.

Thanks for your help it works now.
Aug 15, 2006 at 10:01 PM
originally posted by Craig Lichtenstein - MSFT
-------------------------------------------------------

So, you can build MSBee on the command line with msbuild.exe or using VS 2005. The key difference is that when you change the settings.targets file and build on the command line, msbuild.exe immediately picks up on those changes. This is because msbuild reloads the project files each time you build and those projects files are importing the settings.targets file. Thus, each time you build, your settings.targets file is reloaded.

In the VS IDE, each project is loaded once when you open the MSBee solution. If you try to alter the settings.targets file after you've opened the projects in the IDE, the changes won't take affect until your reload the projects. You can do this by right clicking on each project and selecting Unload Project. Once the project is unloaded, right click on the project again and select Reload Project. Alternatively, you can close the entire solution and reopen it. Until you reload your projects in the IDE, the changes to settings.targets won't take affect.