How to compile Razor Views in Monodevelop 4.2, to get the Errors in the Views while developing? I have tried setting MvcBuildViews to true. But that seems to be not working in Monodevelop.
Related
I created a build pipeline to build a Xamarin Forms app. I added the task:
Build Xamarin.iOS solution **/*.sln
The build is working fine for Xamarin.iOS but it also builds the Xamarin.Android project which is not required for me.
As you can see in this log, it tries to build the Android version which causes an error for me:
'PushNotification' could not be found (are you missing a using
directive or an assembly reference?)
[/PATH/NAME_OF_PROJECT/Droid/NAME_OF_PROJECT.Droid.csproj]
On the "Build Xamarin.iOS solution" step, click the "link settings" button. The following dialog will come up. Select "Solution" from the dropdown and "Unlink":
This will enable the "Solution" field to be editable. In there, you can update it to be **/*iOS*.csproj.
Rebuild, and you will notice it no longer builds the Android project, and only builds the iOS project.
It's building all of the projects in your solution. What we have done in the past to get around this is to make a copy of your .sln file, open, remove all projects that aren't related to iOS, and use that as the .sln for building iOS.
Yesterday I upgraded to Xamarin.Android 7.3.0, and now none of my breakpoints get hit. I've tried many things to try to get breakpoints to work again, but no luck:
Cleaning the solution
Deleting the bin / obj folders
Closing and reopening Xamarin Studio
Restarting my Mac
Creating a new Android project
Rolling back to Xamarin.Android 7.2, Xamarin.Mac 3.2, and Xamarin Studio 6.2.1.
It doesn't make sense to me that even after creating a brand new project and running it with rolled back Xamarin versions, it still doesn't work. This should eliminate it being the code, and eliminate it being the Xamarin update, and yet it still doesn't work.
The pdb files are generated, so that's something. I have my configuration set to Debug-Dev, this has Debug Information set to Full, and Define Symbols set to:
DEBUG;__ANDROID__
I'm not sure what else to try at this point, help would be appreciated!
This seems to be a bug a bug related to mono 5.0 upgrade. Solution from Bugzilla
Alternate possible temporary workaround for users who have hit this issue after updating (as opposed to a fresh install on a new machine)
(For users who might wish to continue to use Xamarin Studio 6.3 for a little while before transitioning completely to Visual Studio for Mac.)
Set "Project > Active Runtime" to "Mono 4.8.0 (8f6d0f6) (/Library/Frameworks/Mono.framework/Versions/4.8.0)".
Rebuild the Android app project.
Explanation
By default the Mono 5.0 installer will leave the Mono 4.8 tools installed alongside the new Mono 5.0 tools. When the Xamarin.Android build process runs under Mono 4.8, it will generate the old .mdb debugger symbol file format for user assemblies, so the Xamarin Studio debugger will be able to use those symbols. Do note though that the framework debugger symbols files for Xamarin.Android are all shipped as portable .pdb files starting with Xamarin.Android 7.3, so stepping into framework code (as opposed to user code) still would not work as expected.
I had this problem for months, the root folder where I had all my projects had a "#" , I renamed it and now the break points are working just fine.
Background:
I used to have VS2010 Professional. Upgraded to VS2010 Ultimate. Installed SP1. Installed MVC3, MVC3 Tools Update
I'm currently working on some custom Orchard modules, and for some reason, I don't see Razor as an installed template. But if I fire up a new ASP.NET MVC3 app, I see it. Has anyone ran into this issue. I've tried uninstalling MVC3 and Tools Update. No luck. Is there something obvious I'm missing?
MVC3 app - as you can see MVC3 View Page (Razor) is available...
From an Orchard Module:
Have you tried to install the Razor engine as a NuGet Package for this solution? Open Package Manager Console (View - Other windows) and enter
Install-Package RazorEngine
Is the System.Web.Mvc.dll included in the references?
For me editing the project file and adding the value {E3E379DF-F4C6-4180-9B81-6769533ABE47} in front of the others guid's for <projecttypeguids> solved the problem.
I know it's possible to compile all views on building the project... but I was wondering if there is a way to compile a single view on demand in the VS2010.
That way, when you change a view, you could compile this one view (instead of letting VS2010 build all views).
As far as I know Microsoft did not yet add support for precompiling Razor views. But the team released a VS2010 extensions that should allow this. You may check out the following blog post from David Ebbo:
Precompile your MVC Razor views using RazorGenerator
Here is another appreach:
Compile your asp.net mvc Razor views into a seperate dll
I have upgraded to MVC3 and Razor, everything works fine. However, in my return View(model); the "View" is red and VS2010 will helpfully suggest I generate a view. When I do, it generates a aspx/WebForms view. There's no other aspx files in the project, and if I run the project, the Razor view engine works fine. There's obviously a setting somewhere that tells VS2010 which to default to, I can't find it. Any suggestions?
These are not explicit answer but rather a list of actions that you could try..
In the csproj file of your project make sure that the <ProjectGuidType> are set to <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
Try changing the ProjectGuid to some other Guid (last post). You will need to update the sln file or simply recreate the solution.
Not sure what method you used to upgrade, but have a look at the MVC 3 Upgrade Tool from CodePlex
If you can create a new ASP.NET MVC 3 project and add a Razor view as expected then the project where you are seeing this behavior is missing the ASP.NET MVC 3 project type guid, which you can find in a new ASP.NET MVC 3 project's .csproj file. If you can't do this than you should try reinstalling the ASP.NET MVC 3 Tools Update.