Bug 24095 - An error occurred while applying transformation to 'Web.config' in project 'test': Argument cannot be null. Parameter name: key
Summary: An error occurred while applying transformation to 'Web.config' in project 't...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NuGet ()
Version: 5.5
Hardware: Macintosh Linux
: --- normal
Target Milestone: master
Assignee: Jo Shields
URL:
Depends on:
Blocks:
 
Reported: 2014-10-28 05:12 UTC by Joseph Carras
Modified: 2015-04-14 03:13 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
MonoDevelop log (34.84 KB, text/x-log)
2014-10-28 08:57 UTC, Joseph Carras
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Joseph Carras 2014-10-28 05:12:07 UTC
After a clean installation of MonoDevelop using the centos repository and after resolving the broken symbolic links links of nunit I tried created an MVC project.

Adding Microsoft.AspNet.Mvc...
Attempting to resolve dependency 'Microsoft.AspNet.WebPages (≥ 3.2.0 && < 3.3.0)'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.Razor (≥ 3.2.0 && < 3.3.0)'.
The Microsoft.AspNet.Razor package has a license agreement which is available at http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm
Please review this license agreement and remove the package if you do not accept the agreement.
Check the package for additional dependencies which may also have license agreements.
Using this package and any dependencies constitutes your acceptance of these license agreements.
The Microsoft.AspNet.WebPages package has a license agreement which is available at http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm
Please review this license agreement and remove the package if you do not accept the agreement.
Check the package for additional dependencies which may also have license agreements.
Using this package and any dependencies constitutes your acceptance of these license agreements.
The Microsoft.AspNet.Mvc package has a license agreement which is available at http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm
Please review this license agreement and remove the package if you do not accept the agreement.
Check the package for additional dependencies which may also have license agreements.
Using this package and any dependencies constitutes your acceptance of these license agreements.
Installing 'Microsoft.Web.Infrastructure 1.0.0.0'.
Added file 'Microsoft.Web.Infrastructure.dll' to folder 'Microsoft.Web.Infrastructure.1.0.0.0/lib/net40'.
Added file 'Microsoft.Web.Infrastructure.1.0.0.0.nupkg' to folder 'Microsoft.Web.Infrastructure.1.0.0.0'.
Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'.
Installing 'Microsoft.AspNet.Razor 3.2.0'.
Added file 'System.Web.Razor.dll' to folder 'Microsoft.AspNet.Razor.3.2.0/lib/net45'.
Added file 'System.Web.Razor.xml' to folder 'Microsoft.AspNet.Razor.3.2.0/lib/net45'.
Added file 'Microsoft.AspNet.Razor.3.2.0.nupkg' to folder 'Microsoft.AspNet.Razor.3.2.0'.
Successfully installed 'Microsoft.AspNet.Razor 3.2.0'.
Installing 'Microsoft.AspNet.WebPages 3.2.0'.
Added file 'System.Web.Helpers.dll' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'System.Web.WebPages.dll' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'System.Web.WebPages.Deployment.dll' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'System.Web.WebPages.Razor.dll' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'System.Web.Helpers.xml' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'System.Web.WebPages.xml' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'System.Web.WebPages.Deployment.xml' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'System.Web.WebPages.Razor.xml' to folder 'Microsoft.AspNet.WebPages.3.2.0/lib/net45'.
Added file 'Web.config.install.xdt' to folder 'Microsoft.AspNet.WebPages.3.2.0/Content'.
Added file 'Web.config.uninstall.xdt' to folder 'Microsoft.AspNet.WebPages.3.2.0/Content'.
Added file 'Microsoft.AspNet.WebPages.3.2.0.nupkg' to folder 'Microsoft.AspNet.WebPages.3.2.0'.
Successfully installed 'Microsoft.AspNet.WebPages 3.2.0'.
Installing 'Microsoft.AspNet.Mvc 5.2.0'.
Added file 'System.Web.Mvc.dll' to folder 'Microsoft.AspNet.Mvc.5.2.0/lib/net45'.
Added file 'System.Web.Mvc.xml' to folder 'Microsoft.AspNet.Mvc.5.2.0/lib/net45'.
Added file 'Web.config.install.xdt' to folder 'Microsoft.AspNet.Mvc.5.2.0/Content'.
Added file 'Web.config.uninstall.xdt' to folder 'Microsoft.AspNet.Mvc.5.2.0/Content'.
Added file 'Microsoft.AspNet.Mvc.5.2.0.nupkg' to folder 'Microsoft.AspNet.Mvc.5.2.0'.
Successfully installed 'Microsoft.AspNet.Mvc 5.2.0'.
Adding 'Microsoft.Web.Infrastructure 1.0.0.0' to test.
For adding package 'Microsoft.Web.Infrastructure 1.0.0.0' to project 'test' that targets 'net45',
>> Assembly references are being added from 'lib/net40'
Added reference 'Microsoft.Web.Infrastructure' to project 'test'.
Added file 'packages.config'.
Added file 'packages.config' to project 'test'.
Added file 'repositories.config'.
Successfully added 'Microsoft.Web.Infrastructure 1.0.0.0' to test.
Adding 'Microsoft.AspNet.Razor 3.2.0' to test.
For adding package 'Microsoft.AspNet.Razor 3.2.0' to project 'test' that targets 'net45',
>> Assembly references are being added from 'lib/net45'
Added reference 'System.Web.Razor' to project 'test'.
Added file 'packages.config'.
Added file 'packages.config' to project 'test'.
Successfully added 'Microsoft.AspNet.Razor 3.2.0' to test.
Adding 'Microsoft.AspNet.WebPages 3.2.0' to test.
For adding package 'Microsoft.AspNet.WebPages 3.2.0' to project 'test' that targets 'net45',
>> Assembly references are being added from 'lib/net45'
>> Content files are being added from 'Content' (not framework-specific)
Added file 'packages.config'.
Added file 'packages.config' to project 'test'.
An error occurred while applying transformation to 'Web.config' in project 'test': Argument cannot be null.
Parameter name: key


When I was looking for more info on the error I found this report:
https://github.com/mrward/monodevelop-nuget-addin/issues/16

Unfortunately replacing the two files provided made the package manager unusable.

Being new to C# and Monodevelop I was not able to find enough information and rebuild them on my own and fix this error.

Could you help me out please?
Comment 1 Matt Ward 2014-10-28 08:50:28 UTC
Would you be able to attach the IDE log with the NuGet exception? You can get to the logs from the Help menu -> Open Log Directory.

That issue from the old addin should be fixed in Xamarin Studio 5.5 since it is essentially the same code base. However the callstack from the IDE log will show us where the exception is coming from.
Comment 2 Joseph Carras 2014-10-28 08:57:41 UTC
Created attachment 8527 [details]
MonoDevelop log

This is the full log for the Argument cannot be null exception.
Comment 3 Joseph Carras 2014-10-28 09:06:45 UTC
Hey Matt I have just attached the log! I did figure a way to get around this error so I can start learning and working with MonoDevelop but its just a workaround and I will post it here for others.

What I did was I enabled the Jenkins repo and installed the monodevelop-snapshot-latest with yum. For how to do this here is the link (http://www.mono-project.com/docs/getting-started/install/linux/ci-packages/).

Then I used the script mono-snapshot script and loaded the 5.7 version.
( . mono-snapshot monodevelop ) -- the dot and the space after in the beginning is needed!

Then I loaded the monodevelop from the terminal with monodevelop and created the project successfully. Unfortunately the 5.7 latest snapshot has a bug and whenever I click somewhere I get an error, so what I did was I closed mono develop 5.7 and loaded the normal 5.5 and loaded the solution and it worked fine.

So I guess the error is already fixed, but has not yet been push on the stable repo.

If you need any other info let me know!
Comment 4 Matt Ward 2014-10-28 09:13:37 UTC
Yep, you were correct about it being the same problem you linked to on GitHub. It looks like MonoDevelop 5.5 on your machine is using the wrong Microsoft.Web.XmlTransform.dll, or compiling its own version using the wrong source code somehow, or the NuGet addin is too old. The original bug was fixed a while ago before the NuGet addin was fully integrated into MonoDevelop 5.0. I would check the version in the MonoDevelop.PackageManagement.dll it should be 0.5 or above to have this fix.

The binaries that it should be using are available from GitHub:

https://github.com/mono/nuget-binary

You should be able to use the Microsoft.Web.XmlTransform.dll from the above repository. That should have the fix for the XmlAttribute.set_Prefix bug in Mono.
Comment 5 Joseph Carras 2014-10-28 09:28:38 UTC
Hey Matt!

The files that you provided with github worked great!

I just replaced the files in the i got into /usr/lib/monodevelop/AddIns/MonoDevelop.PackageManagement

Fixed the permission and selinux flags, restarted the monodevelop, created the project and no problems at all!

The previous files I had I did not compile my self (actually have no idea how to do this yet) and I actually goth them from the official stable repo found
http://download.mono-project.com/repo/centos/

The RPM files found there have more problems that did not even reported. It took me a couple of hours to get monodevlop running because symbolic links were missing, so probably those RPM have not been update to include your fix.

Anyhow, thanks a lot, going back to playing with mono!
Comment 6 Jo Shields 2014-10-29 09:41:13 UTC
Can you confirm whether monodevelop-5.5.0.227-1.noarch.rpm, which I just published to mono-project.com, is better behaved for you?
Comment 7 Joseph Carras 2014-10-29 16:26:20 UTC
Hey Jo! Sorry for the delay!

Well kinda! In order to get it to work this is what I had to do step by step to resolve broken dependencies and to fix the missing symbolic links:

yum install mono-complete (might not be necessary did it anyway)

yum install gnome-sharp (This is a MUST. If you don't do this the next line fails because it requires a lower version of gnome-sharp while others require a newer version and it fails)

yum install monodevelop (If you did the above command this will successfully install monodevelop but it will not run unless you do the commands below)

Here are the symbolic links for fedora!
cd /usr/lib/mono
mkdir nunit
chcon -R --reference=gtk-sharp-2.0/ nunit/ (This is to set selinux permission right. Might not be necessary but I always set up selinux as soon as I do something on the system)
cd nunit/
ln -s ../4.5/nunit.core.dll 
ln -s ../4.5/nunit.core.interfaces.dll 
ln -s ../4.5/nunit.framework.dll 
ln -s ../4.5/nunit.util.dll

mkdir /etc/mono/registry
mkdir /etc/mono/registry/LocalMachine/
chcon -R --reference=/etc/mono/mconfig /etc/mono/registry (Again selinux for fedora)
 

Then I load monodevelop and runs perfect! And yes it has the nice version of the packager and I was able to create a razor MVC project with nUnits and every things run perfectly!

Thanks a lot!!!

If you need any more info let me know!