Bug 10859 - ASP.NET templates completely broken by C# provider
Summary: ASP.NET templates completely broken by C# provider
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-03-03 17:04 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-03-26 07:59 UTC (History)
2 users (show)

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

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:
VERIFIED FIXED

Description Mikayla Hutchinson [MSFT] 2013-03-03 17:04:00 UTC
System.InvalidOperationException: Cannot use ToTypeSystem() on a syntax tree without file name.
   at ICSharpCode.NRefactory.CSharp.SyntaxTree.ToTypeSystem() in c:\Users\Michael\vcs\monodevelop\main\external\nrefactory\ICSharpCode.NRefactory.CSharp\Ast\SyntaxTree.cs:line 159
   at MonoDevelop.CSharp.CSharpEnhancedCodeProvider.ParseInternal(TextReader codeStream) in c:\Users\Michael\vcs\monodevelop\main\src\addins\CSharpBinding\MonoDevelop.CSharp\CSharpEnhancedCodeProvider.cs:line 87
   at MonoDevelop.CSharp.CSharpEnhancedCodeProvider.Parse(TextReader codeStream) in c:\Users\Michael\vcs\monodevelop\main\src\addins\CSharpBinding\MonoDevelop.CSharp\CSharpEnhancedCodeProvider.cs:line 59
   at MonoDevelop.Ide.Templates.CodeTranslationFileDescriptionTemplate.CreateContent(Project project, Dictionary`2 tags, String language) in c:\Users\Michael\vcs\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Templates\CodeTranslationFileDescriptionTemplate.cs:line 104
   at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.CreateFileContent(SolutionItem policyParent, Project project, String language, String fileName, String identifier) in c:\Users\Michael\vcs\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Templates\SingleFileDescriptionTemplate.cs:line 264
   at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.SaveFile(SolutionItem policyParent, Project project, String language, String baseDirectory, String entryName) in c:\Users\Michael\vcs\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Templates\SingleFileDescriptionTemplate.cs:line 204
   at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddFileToProject(SolutionItem policyParent, Project project, String language, String directory, String name) in c:\Users\Michael\vcs\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Templates\SingleFileDescriptionTemplate.cs:line 113
   at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddToProject(SolutionItem policyParent, Project project, String language, String directory, String name) in c:\Users\Michael\vcs\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Templates\SingleFileDescriptionTemplate.cs:line 108
   at MonoDevelop.Ide.Templates.FileTemplateReference.AddToProject(SolutionItem policyParent, Project project, String language, String directory, String entryName) in c:\Users\Michael\vcs\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Templates\FileTemplateReference.cs:line 83
   at MonoDevelop.Ide.Templates.ProjectDescriptor.InitializeItem(SolutionItem policyParent, ProjectCreateInformation projectCreateInformation, String defaultLanguage, SolutionEntityItem item) in c:\Users\Michael\vcs\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Templates\ProjectDescriptor.cs:line 162
Comment 1 Mikayla Hutchinson [MSFT] 2013-03-03 20:46:18 UTC
Even if I hack the provider to set a filename, the generated files are broken because they are missing the usings.
Comment 2 Mike Krüger 2013-03-04 04:27:20 UTC
fixed

btw. the hack in the CSharpEnhancedCodeProvider is a good approach for the global usings :)

I put them in an extra namespace and daniel just ignored them - replicating them in all namespace is a much better solution.

Stuff like that should be better fixed upstream.
Comment 3 Atin 2013-03-26 07:59:25 UTC
Today we have checked this issue with following builds:

Windows8
X.S 4.0.3.13
Xamarin.Android 4.6.02000

To verify this issue we have created all templates under ASP.Net after that  build and Run all templates and we are successfully able to run all templates.

Changing the status to Verified.