This project has moved. For the latest updates, please go here.

Error when no licenseheader file is present

Jul 11, 2011 at 11:22 AM

Hi,

I just tried to add headers to all files in a project which didn't have licenseheader file and got a message I didn't have one
I clicked ok to create a new licenseheader file and got an Object reference not set to an instance of an object error.
An empty file was created however, but the error was not expected to me.

Eugenio

Developer
Jul 11, 2011 at 4:07 PM

Can you provide some more details?

What kind of project are you working with?
Does it work in an empty project?

Jul 11, 2011 at 4:27 PM

Hi Skleni,

At first it was an ASP.NET MVC 3 project I was working on, then I created an empty ASP.NET project and it did the same.

It's fairly easy to reproduce for me, just:

  1. create a new ASP.NET project (I didn't try others)
  2. select License Headers / Add License Headers to All Files
  3. say yes to No license header definition file found in this project. Do you want to add a new file?
  4. and boom, you have the error message
  5. trying again without closing the project I got this

---------------------------
Microsoft Visual Studio
---------------------------
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
---------------------------
OK  
---------------------------

I hope that helps

Developer
Jul 12, 2011 at 7:21 AM

Hm, I tried various kinds of projects now, but they all seem to work fine here. Do you have any additional extensions installed?

Does it work if you use the "Add New License Header Definition File to Project" command?

Jul 14, 2011 at 11:02 PM

I found out what was happening, I have installed Solution Navigator, which is part of Productivity Power Tools and I was trying to open from the menu I got there.
When I saw the original Solution Explorer tab I imagined that it could work there, and tried and it did work perfectly.

The fact is that the menu appears on both windows and I didn't realize at first that they were so different.

I think this could help you workaround the problem.

Eugenio

Developer
Jul 27, 2011 at 7:11 AM

Thanks for the hint, I'll investigate the issue.