I'm using Visual Studio 2010 SP1, ASP.NET MVC 3 + tools update. When I try to add a strongly typed razor view to a controller action, VS throws an error "the templates had the following 1 error(s) when running: "
The 'ReferencedAssemblies' property cannot contain null or empty strings.
Parameter name: options
at Microsoft.VisualBasic.VBCodeGenerator.CmdArgsFromParameters(CompilerParameters options)
...
I have tried to 'clean' the project, shut down VS, reopen VS, rebuild, but I still got the same error.
Only 'empty' scaffold template works. List, details, edit, etc throw the same error.
Anybody has a solution for the error?
I managed to fix the problem using the following steps:
remove reference to the library containing the model
clean project
close VS
reopen VS
rebuild project (VS throws errors)
re-add reference to the model library
rebuild project
After that, VS can successfully build the view.
EDIT
I noticed that in the process of doing the steps above, I also closed git bash console that was open on the project folder. I tried just closing the git shell, and I became able to generate views without doing the steps above. Looks like the git shell locks some files, and this causes the error when generating views.
Related
I am trying to open a solution that involves an MVC project in Visual Studio that was developed in VS 2010. After I open the solution, I get this error:
Unsupported
This version of Visual Studio is unable to open the following projects. The project types
may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets,
please see the details in the "Migration Report" displayed after clicking OK.
The migration report contains this message:
The application which this project type is based on was not found.
Please try this link for further information:
http://go.microsoft.com/fwlink/?LinkID=299083&projecttype=F85E285D-A4E0-4152-9332-AB1D724D3325
I tried the following approaches (in no particular order)
Repair VS
Run devenv /Setup in the solution directory
Delete the .user file associated with the project
Repeat of all of those steps after rebooting my computer
Install MVC 3 and create an MVC project as described in the link in the migration report. Here, the described files (e.g /Views/Web.config) don't seem to exist.
What changes do I need to make to make the MVC project compatible?
Not sure what code/config files I would need for this, but please comment on any further info that could be helpful.
I have created a new project for Xamarin in Visual Studio 2017 Community Edition 15.8.3. Then I added a few changes in the MainPage.xaml and cs and now I am getting these error on building the solution.
The errors refer to styles.xml which I didn't touch.
I was seeing this error earlier which required required restarting VS, rebooting computer, cleaning obj and bin directories, upgrading VS, etc.
I prefer to not do such things blindly.
Is there any systematic solution for this problem?
See if you have not change any of this in the MainPage.xaml
If not put here your content in that page just to see if anyone see the error.
This worked for me in a VS2017 cross-platform solution targeting Android 7.1:
Clean your project and rebuild it.
Change each XAML file properties:
Change the Build Action from "Embedded Resource" to "Compile" or "C# compiler"
Rebuild your project (it will produce errors)
Close VS2017 and delete the .VS folder and reopen solution
Change each XAML file properties:
Change the Build Action back to "Embedded Resource"
Rebuild and it was good for me.
On a separate project, the solution above did not resolve my errors and I also performed these additional steps with success:
Using this guide, I was able to determine that I was missing the following Nuget reference:
Xamarin.Android.Support.v7.AppCompat
After clean and build, close, delete .VS folder and reopen... I checked the log again and was able to determine that I was missing the following Nuget reference:
Xamarin.Android.Support.Design
Another clean and build and those problems went away... leaving me with remnant code issues that I was able to resolve.
After another clean and build... I received another error that I was missing the following Nuget reference:
Xamarin.Android.Support.v7.CardView
Another clean and build... no errors.
I'm using Microsoft Visual Studio 2013 professional on a windows 10 laptop and I am seeing an error in all my razor views. The error says the name 'X' does not exist in the current context e.g. The name 'Html' does not exist in the current context.
From searching the internet for solutions I have tried the following but still not fixed
Run visual studio repair form control panel (uninstall programs)
Run Windows update
Checked that the references are set to copy local
Deleted my .suo file, cleaned and rebuilt
Tried fully qualified namespaces
Razor versions are 3.0 in both config and view config
Unload Reload the project
Reset all my settings using import and export settings wizard
Cleaned all packages and cleared package cache
The error looks like so
Can anyone suggest anything else apart from uninstalling and then reinstalling? Despite these errors in my views the application will still build and run in the browser with no ysod.
SIMILAR ISSUE "The name 'HTML' does not exist in the current context" in MVC 3 Views
EDIT - Using info from stackoverflow.com/questions/20422007/… if i go to project properties and make a space in assembly name and save and rebuild then it works!! However as soon as i close VS down and start it up again the issue persists
Thanks
Paul
How sure are you that this is a visual studio issue, and not related to the project? Does it work in other versions of Visual Studio? Do you have the .Net framework installed? (Ensure your project is pointing to the correct .net framework version that you have installed, which you can check in the project properties).
Is the assembly reference in question that's missing, present in the bin folder of your solution?
My application had a post build event in it but I was removing due to some required changes resulting in the following error.
The target "PostBuildEvent" does not exist in the project
So I went into my projects properties > Build Events to remove it. However once removed I would still get the error while executing the application. I then opened my .csproj to manually remove the post build event from there but that had the same result. Am I not removing the post build event properly or is there some kind of error occurring here? If there is an error what is a possible solution?
Update:
It doesn't seem to solely be a problem with any one application but all applications in Visual Studio, including new applications.
A reinstallation of Visual Studio has successfully solved the problem.
I'm trying to define a new build on TFS using VS2012. When I go to New Build Definition -> Processes I'm seeing "Build process template" and an empty drop down.
I click on the "New..." button selects the default template from
$/<My Project Name>/BuildProcessTemplates/DefaultTemplate.11.1.xaml
and click OK but then I'm getting the error:
TF277000: A build process template for '$/<My Project Name>/BuildProcessTemplates/DefaultTemplate.11.1.xaml' already exists for team project <Project Name>. You cannot create another build process template for the same file. Use the existing one instead.
the drop down always stay empty. I tried to clean cache(AppData\Local\Microsoft\Team Foundation\4.0) and other sort brilliant tricks like close and open but nothing helped - the drop down stays empty.
I would really appreciate aמy help.
I had a similar issue crop up recently.
Background: TFS 2012 Project with multiple solutions under 1 Project Collection project. The 'BuildProcessTemplates' folder did exist in the Project collection project and did contain the standard templates. The solution was created in TFS 2012 and being coded using VS 2012 ultimate.
Symptoms: Any attempts to create a Build Definition failed due to a lack of Templates.
Actions - unsuccessful: I created a copy of the default template and used that for a template. I wasn't able to create a Build Definition since even with that, the dropdown was still empty. Also tried creating a custom template with the same lack of success.
Actions - successful: I separated the solutions into their own Project Collections projects. That put the solution at the same level as the 'BuildProcessTemplates' folder. Once that was accomplished, I was able to create a Build Definition for those solutions.
Comments: I'm not sure if this is a bug in TFS 2012 or not. I would like to think if it is a bug in TFS 2012, it is corrected in TFS 2013.
Your thoughts?
Robert
I recently ran into the same problem with not being able to see build process templates when trying to add a new build definition. We are in TFS 2012. This team project also appeared not to have any build definitions. That was expected though because we had not yet used the TFS builds on this team project.
The problem was caused by someone with admin rights setting the "View build definition" and the "View Builds" access rights to Deny for everyone.
By just setting that back to allow on the TFS group, we suddenly could see the build definitions and also were able to select build process templates.
It was really strange that it let us add new build process templates, but we couldn't select them.