<files> element

Feb 22, 2011 at 6:20 PM

Hi there,

I'm trying to create nuget packages for ELMAH 1.2 using our standard build, which creates files in locations:

  • bin\net-1.0\release\elmah.dll
  • bin\net-1.1\release\elmah.dll
  • bin\net-2.0\release\elmah.dll

I want to package these up using nuget but things don't work out quite how I want them to:

  1. I can't really use the convention based packaging unless I have batch files to copy the dlls from one location to another - but I don't really want to go down that route unless I have to
  2. This doesn't work:
    • <file src="bin\*\release\elmah.dll" target="lib" />
  3. Neither does this:
    • <file src="bin\net-1.0\release\elmah.dll" target="lib" />
    • <file src="bin\net-1.1\release\elmah.dll" target="lib" />
    • <file src="bin\net-2.0\release\elmah.dll" target="lib" />
  4. Nor does this:
    • <file src="bin\net-1.0\release\elmah.dll" target="lib\net10" />
    • <file src="bin\net-1.1\release\elmah.dll" target="lib\net11" />
    • <file src="bin\net-2.0\release\elmah.dll" target="lib\net20" />

Any ideas how I can accomplish what I want without going down the batch file route???

Thanks,

James

Coordinator
Feb 22, 2011 at 6:33 PM

I’m surprised that last one doesn’t work. What happens?


Phil

Feb 22, 2011 at 8:23 PM

Hi Phil,

I've unzipped the package and the files exist in the correct folders, but when I install the package and then build nothing gets copied across to the bin folder, and I get errors with elmah.dll not being found upon starting my test project.

Thanks,

James

 

Coordinator
Feb 22, 2011 at 9:09 PM
Edited Feb 22, 2011 at 9:38 PM

Try examining the package using the package explorer. Do you see the files in there? http://nuget.codeplex.com/releases/59864/clickOnce/NuGetPackageExplorer.application

 

Also, when you run the build, do you see any messages in your output window? Are you sure those are the correct paths?

 

If none of the above steps help, try creating an issue in our issue tracker (http://nuget.codeplex.com/workitem/list/advanced) and attach the package to that issue?


 

Feb 22, 2011 at 9:33 PM

Hi Phil,

I've tried the Explorer too, and can see the files there as well!

I've created a work item: http://nuget.codeplex.com/workitem/729 with the nupkg attached as suggested.

Thanks,

James

Coordinator
Feb 22, 2011 at 9:41 PM

Works on my machine. :)

Keep in mind that when you install it into a Web Application Project (such as Web Forms or MVC), it doesn't copy them into your bin directory until you compile. What kind of project are you installing it into?

After installing it, do you see the Elmah assembly in the references node?

Developer
Feb 22, 2011 at 9:56 PM

Try updating NuGet.exe

Feb 22, 2011 at 10:19 PM

Worked in setup as well. I tested using the package attached to work item 729 in VS 2010 on a fresh ASP.NET Web Application project and using a local package repository on my local drive. James, what setup did you try it against?

Feb 22, 2011 at 10:49 PM

@dfowler - have run "nuget.exe update" and got the latest version (v1.2.20216.59) before compiling my package

Am in VS2010 - have created a new project -> Visual C# | Web | ASP.NET Application | Net Framework 2.0

Then Install Library Package (VSIX v1.1.229.160)... and selected from my local source

Have built the application and no references to ELMAH nor a copy to the bin folder.

Have I got a versioning issue??

 

Thanks,

 

James

Coordinator
Feb 22, 2011 at 11:25 PM

I just went through those steps and it worked for me. Just to be absolutely detailed, I have NuGet 1.1.229.160 installed just like you do.

· Added a local folder into my Package Source settings and included the ELMAH you attached into there.

· In VS 2010 -> File | New | Project

· Change target framework to be .NET 2.0

· Select ASP.NET Web Application

· Right click references

· Select “Local” package source in the Online tab

· Clicked on ELMAH

· Clicked “Install”

After running those steps, I see Elmah in the References node. I compiled and it worked fine.

Feb 22, 2011 at 11:34 PM

James, if you're using Windows 7, I suggest using Problem Steps Recorder and posting the recorded session here. PSR will gather all your clicks in VS as full screenshots and give us a chance to “see” what's really going on.

Feb 22, 2011 at 11:56 PM

@Atif I've uploaded it here: http://2jsltd.co.uk/elmah-nuget.zip

Coordinator
Feb 23, 2011 at 12:15 AM

Weird. I tried these exact steps and it works for me. Could you send the version of VS you’re using? Do you have access to another machine with VS?

Feb 23, 2011 at 12:17 AM

Unfortunately, there was nothing recorded after step 22, which is where you were going to open bin directory after selecting Show All Files. The suspence just killed me. :)

What did your Output pane show (with Show output from: Package Manager selected) after installing the ELMAH package? Mine read as follows:

------- Installing...Elmah 1.2 -------
Added file 'web.config.transform' to folder 'Elmah.1.2\content'.
Added file 'Elmah.dll' to folder 'Elmah.1.2\lib\Net11'.
Added file 'Elmah.dll' to folder 'Elmah.1.2\lib\Net20'.
Added file 'Elmah.1.2.nupkg' to folder 'Elmah.1.2'.
Successfully installed 'Elmah 1.2'.
Added file 'web.config'.
Added file 'web.config' to project 'WebApplication1'
Added reference 'Elmah' to project 'WebApplication1'
Added file 'packages.config'.
Added file 'packages.config' to project 'WebApplication1'
Added file 'repositories.config'.
Successfully added 'Elmah 1.2' to WebApplication1.
==============================
 

Coordinator
Feb 23, 2011 at 12:19 AM

You didn’t need to see the bin dir. If you notice, the References node doesn’t have ELMAH after installing.

One thought, did you wait a second before clicking the “Close” button? It could it be possible that we show the button too early before the installation is actually done. Just guessing here.

Feb 23, 2011 at 12:26 AM

@Haacked: I noticed that but still I wanted to see the end of the movie even if I knew who was the bad guy. :) What's even strange is that you do see a packages.config added, but no packages directory in step 22.

James, if GUI race conditions might be an issue then it may be worthwhile trying to install from the Package Manage Console. Does that yield any different results?

Feb 23, 2011 at 8:51 AM

Hi guys,

Sorry if I missed some steps there... I was getting quite tired here!

I've uploaded a new psr trace in the same location:

PM> install-package elmah -verbose

You are downloading ELMAH from Atif Aziz, the license agreement to which is available at http://www.apache.org/licenses/LICENSE-2.0. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.

Added file 'web.config.transform' to folder 'ELMAH.1.2\content'.
Added file 'ELMAH.1.2.nupkg' to folder 'ELMAH.1.2'.
Successfully installed 'ELMAH 1.2'.
Added file 'web.config'.
Added file 'web.config' to project 'WebApplication6'
Added file 'packages.config'.
Added file 'packages.config' to project 'WebApplication6'
Added file 'repositories.config'.
Successfully added 'ELMAH 1.2' to WebApplication6.

I am running VS2010 Professional here 10.0.30319.1 RTMRel

I'm off to the office soon to check things out under VS2010 Ultimate.

Cheers,

James

Feb 23, 2011 at 2:13 PM
Edited Feb 23, 2011 at 2:26 PM

I've now tried things in the office and things work... 

I've got 1.1.229.160 installed at home... 
At the office I had 1.0.11220.104 installed... that worked fine.
So I upgraded to the latest on nuget.org, and I've now got 1.1.229.160 - that works fine too!

Curious!!

Cheers,

James 

Coordinator
Feb 23, 2011 at 4:52 PM

1.2? You might have pulled that from our Continuous Integration server. That’s work in progress.

Feb 23, 2011 at 5:16 PM

Hi Phil,

Sorry for any confusion... I edited my post above as it was incorrect... I've got version 1.1.229.160 of the VSIX at home and at the office - both pulled from http://nuget.org

I've got v1.2.20216.59 of NuGet.exe at home - which I got by running nuget.exe update

I wouldn't have thought that this was an issue as it seems to only affect the running instance of nuget.exe - however, is that coming from the CI server or is it the correct version of nuget.exe to be using??
It does seem a little weird to be using a v1.2 of nuget.exe when everything else is v1.1!!

Cheers,


James

Coordinator
Feb 23, 2011 at 5:19 PM

Well this should work for all versions of NuGet. J So to clarify, the only difference is that at home you have VS Pro and at work it’s VS Ultimate? If you can find any other differences, we can try to debug this.

Feb 23, 2011 at 5:45 PM

:O)

Here's the differences I can think of:

1) VS 2010 Pro (home) vs VS2010 Ultimate (office)
2) Home has all the JetBrains products installed (R#, dotTrace Memory, dotTrace Performance, dotCover) - no productivity tools at the office :O(
3) Home is Windows 7 Premium 64 Bit - office is Windows XP SP3
4) I think I've probably got different installation options selected between the two environments... here's my working config (below) taken from Help | About -> Copy Info (I'll post the home config when I get back later tonight - or this morning for you!!)
5) I'll check on Reflector versions too - I've got 6.5.0.135

Happy to help in any way I can - if you've got any debugging ideas send them on and I'll try them out!

Thanks,

James

-------------------------------------------------------------------

Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel

Installed Version: Ultimate

Microsoft Office Developer Tools   01019-532-2002102-70466
Microsoft Office Developer Tools

Microsoft Visual Basic 2010   01019-532-2002102-70466
Microsoft Visual Basic 2010

Microsoft Visual C# 2010   01019-532-2002102-70466
Microsoft Visual C# 2010

Microsoft Visual Studio 2010 Architecture and Modeling Tools   01019-532-2002102-70466
Microsoft Visual Studio 2010 Architecture and Modeling Tools
   
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Microsoft Visual Studio 2010 Code Analysis Spell Checker   01019-532-2002102-70466
Microsoft Visual Studio 2010 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Microsoft Visual Studio 2010 Team Explorer   01019-532-2002102-70466
Microsoft Visual Studio 2010 Team Explorer

Microsoft Visual Web Developer 2010   01019-532-2002102-70466
Microsoft Visual Web Developer 2010

NuGet Package Manager   1.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://nuget.codeplex.com.

Oracle Developer Tools for Visual Studio   11.2.0.1.2
Oracle Developer Tools for Visual Studio Copyright (c) 2005, 2010

SAP Crystal Reports for Visual Studio 2010  
SAP Crystal Reports for Visual Studio 2010


Update for Microsoft Visual Studio 2010 Ultimate - ENU (KB2483190)   KB2483190
This update is for Microsoft Visual Studio 2010 Ultimate - ENU.
If you later install a more recent service pack, this update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/2483190.

Coordinator
Feb 23, 2011 at 5:50 PM

Also, at home, do any other packages fail? Or do they all seem to work except this one?

Phil

Feb 23, 2011 at 7:08 PM

Hi Phil,

I've got home and fired us VS, and all of a sudden everything has started working...
I have tried various different ways of doing things and everything is now working as expected!!

Who knows what's gone wrong here, but all I can say is thank you VERY much for all your patience and assistance in trying to resolve this with me.
If I didn't have the psr traces to show what I was experiencing, I would've said it was total brain fade on my part!!
Thanks Atif for that one!! :O) 

Unless there's anything else I can do to help work out what went wrong, I'll sign off this post and close my workitem!

Many thanks,

James 

Coordinator
Feb 23, 2011 at 7:10 PM

We have some known caching issues with NuGet and packages. It could be that an older ELMAH package that didn’t work was cached. And you were installing that one each time. J

In any case, glad it’s working and not an unknown bug!

Feb 23, 2011 at 8:41 PM

Thanks Phil!