Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Currently, when using attributes in Razor, the engine generates horribly overcomplicated calls to a WriteAttributeMethod:
We need to implement WriteAttribute and WriteAttribute to on the Generated class, ideally also simplifying the signature a LOT.
To do this we may need to plug in altered generators:
We should also look at the other class and method names defined on GeneratedClassContext and either implement them or write code to make using these features a generation-time error:
In some cases, it may be necessary to alter the generators:
We have tried to reproduce this issue. But we are not sure about steps.
Could you please provide some steps or sample application so that we can verify this issue?
In a C# project in Xamarin Studio (for instance, create a new iOS project), add a Preprocessed Razor Template:
File-> New File... -> Text Templating -> Preprocessed Razor Template
In the new (i.e., test.cshtml), add this line:
Verify that the generated file (i.e., test.cs) has a call to "WriteAttribute", i.e.,:
WriteAttribute ("href", " href=\"", "\""
Verify that the project builds (i.e,. before this bug was fixed, WriteAttribute was not defined)
As per steps mention in comment 3, we are able to check that WriteAttribute
i.e. "WriteAttribute ("href", " href=\"", "\""
Screencast : http://screencast.com/t/QnzDOD7JFjVi
Hence closing this issue.