I just started learning Xamarin and I am having some problems. I created a new Android App Project, using a Single View App. I just open the activity_main.axml using the solution explorer and after it loads, i get the following error: "This project contains resources that were not compiled successfully, rendering might be affected." Even if I try to rebuild the solution, the error persists.
Worth mentioning: this happens without editing/writing any code and without adding any objects through the toolbox.
Any ideas? Thanks!
Try to go on your project's folder and delete "bin" and "obj" folders from android project.
Clean your solution and then rebuild it, it may work.
Check your project on Embedded Resource Environment
then try to this step:-
-Delete "obj" "bin"
-Clean Your project
-Re-build project
Related
I am working on an ASP.NET MVC project and so far I had no problems with scaffolding any type of items until now.
Every time I want to create a new controller or view, I get the following error message:
There was an error running the selected code generator: 'The value -1 is outside the acceptable range of [0,2147483647]. Parameter name :value'
This issue only arises in the project that I'm currently working on as I tried creating a new controller in another project and it worked flawlessly.
I already tried the solution to delete the ComponentModelCache folder and rebuilding the project but the problem still persists.
My Visual Studio 2019 is also up to date.
EDIT:
Pulling the project from git source control on another PC and restoring the packages fixed the issue for me. You probably don't have to do it from another computer, just try deleting the project and restoring it from remote.
EDIT 2:
Creating a second view and the same problem is back again...
I fixed this by unloading and reloading the project
You just need to - delete ".vs" folder from your solution directory.
In summary only the deleting of the .vs folder is what has worked for me.
On reopening VS2019 16.2.3 - I can now add in Controllers and Views without seeing this error.
Found it from Microsoft Developer Community site: https://developercommunity.visualstudio.com/content/problem/626755/error-running-the-selected-code-generator-value-1.html?childToView=684261#comment-684261
code-generator-solution
This issue has been resolved in Visual Studio 2019 version 16.2.4. The release notes are available here:
https://learn.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.2.4
One of the possibility is if your web.config file is open then this error might appear. Try closing the web.config file and then add a View.
You can also reach out to this website for more reference: Error Running the Selected Code Generate Value
Hope this helps.
I was able to fix this by replacing the web project with a new one.
-I renamed the project like project_old folder and removed it from solution.
-Added a new project to the solution by right click and add project
-Created the old controllers and everything with copying from old project files
-Updated nuget packages and deleted old project files
Clean Solution -> Rebuild Solution and voilla
i fix it, deleting the .vs folder, re opening the project, and clenning the solution
Close all documents, and try again to create new controller.
It works for me in Visual Studio 2019 asp.net MVC but I don't know why
I was able to fix this by manually deleting the BIN and OBJ folders for my projects. Running Clean in Visual Studio did not work.
I was getting this error - as my project is a git repository, I ran git clean -xfd on it, then rebuilt it and was able to add a controller when I tried again.
try both any one will work either of them.
1.Just delete .vs folder in project solution.
2.If above fix does not work.,close your web.config file if it is opened.
I tried it all and finally found a solution that worked, this issue only happens when the web.config file is open in the editor. Hope this help.
Credits :
Vijay Ramakrishnan [MSFT]
https://developercommunity.visualstudio.com/content/problem/626755/error-running-the-selected-code-generator-value-1.html
I fixed this by matching the version of "Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" to the rest.
Replaced everything that was 5.0.9 with 5.0.2 and it worked.
Go Back to VS 2017 and it will work just fine
just use vs15. In many regards vs19 is still beta...
I am working on an ASP.NET MVC project and so far I had no problems with scaffolding any type of items until now.
Every time I want to create a new controller or view, I get the following error message:
There was an error running the selected code generator: 'The value -1 is outside the acceptable range of [0,2147483647]. Parameter name :value'
This issue only arises in the project that I'm currently working on as I tried creating a new controller in another project and it worked flawlessly.
I already tried the solution to delete the ComponentModelCache folder and rebuilding the project but the problem still persists.
My Visual Studio 2019 is also up to date.
EDIT:
Pulling the project from git source control on another PC and restoring the packages fixed the issue for me. You probably don't have to do it from another computer, just try deleting the project and restoring it from remote.
EDIT 2:
Creating a second view and the same problem is back again...
I fixed this by unloading and reloading the project
You just need to - delete ".vs" folder from your solution directory.
In summary only the deleting of the .vs folder is what has worked for me.
On reopening VS2019 16.2.3 - I can now add in Controllers and Views without seeing this error.
Found it from Microsoft Developer Community site: https://developercommunity.visualstudio.com/content/problem/626755/error-running-the-selected-code-generator-value-1.html?childToView=684261#comment-684261
code-generator-solution
This issue has been resolved in Visual Studio 2019 version 16.2.4. The release notes are available here:
https://learn.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.2.4
One of the possibility is if your web.config file is open then this error might appear. Try closing the web.config file and then add a View.
You can also reach out to this website for more reference: Error Running the Selected Code Generate Value
Hope this helps.
I was able to fix this by replacing the web project with a new one.
-I renamed the project like project_old folder and removed it from solution.
-Added a new project to the solution by right click and add project
-Created the old controllers and everything with copying from old project files
-Updated nuget packages and deleted old project files
Clean Solution -> Rebuild Solution and voilla
i fix it, deleting the .vs folder, re opening the project, and clenning the solution
Close all documents, and try again to create new controller.
It works for me in Visual Studio 2019 asp.net MVC but I don't know why
I was able to fix this by manually deleting the BIN and OBJ folders for my projects. Running Clean in Visual Studio did not work.
I was getting this error - as my project is a git repository, I ran git clean -xfd on it, then rebuilt it and was able to add a controller when I tried again.
try both any one will work either of them.
1.Just delete .vs folder in project solution.
2.If above fix does not work.,close your web.config file if it is opened.
I tried it all and finally found a solution that worked, this issue only happens when the web.config file is open in the editor. Hope this help.
Credits :
Vijay Ramakrishnan [MSFT]
https://developercommunity.visualstudio.com/content/problem/626755/error-running-the-selected-code-generator-value-1.html
I fixed this by matching the version of "Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" to the rest.
Replaced everything that was 5.0.9 with 5.0.2 and it worked.
Go Back to VS 2017 and it will work just fine
just use vs15. In many regards vs19 is still beta...
All .cs file in my Xamarin project are Miscellaneous files http://prntscr.com/cp3q4w . I have no Quick Actions and Refactorings support, and it seems like there is somehow missing reference to Xamarin.Forms http://prntscr.com/cp3qzr ,but i dont get compile error for not recognizing xamarin components.
This is Xamarin.Forms Shared project.
Tried with this solution:
i) Clear the cache
ii) Open the solution
iii) Unload all projects
iv) Load Android project and then fix nuget references
v) Once the references were fixed, I loaded the shared project. Now everything seems to work.
But, didn't succeed.
Anyone had similar problem? Any suggestions for solution?
Thanks.
First thing to try if your solution is checked in to source control:
Do a full Git clean to make sure there are no left over files stopping compilation
Clear your NuGet cache. (How to clear NuGet package cache using command line?)
Try again.
If this fails, try this:
Starting a new Visual C# -> Cross Platform -> Mobile App (Xamarin.Forms) solution in Visual Studio 2017. I recommend trying a ".NET Standard" project rather than a "Shared Project".
Make sure the solution compiles and runs to make sure you have all the necessary components for Xamarin Installed.
Do a back up of this clean solution, or commit it to source control.
Upgrade all the NuGet packages if necessary
Pull all the files in from your old solution and see if you get the same problem. Just remember to make sure that the files are added as the correct type of file. For example xaml files must be set to "Embedded resource".
If you still have trouble, please post the error that you get, and upload your solution somewhere so we can have a look.
This also happened to me.
It still does every now and again.
These steps work for me:
Close your solution.
Delete the packages folder from your solution folder or just rename it to packages.old
Open your solution and restore the NuGet packages.
The new class will now show up correctly and your intellisense should work again.
Does anyone have an idea what could cause this though as I don't see any errors when building?
I created a C# Website using Visual studio 2015 in my laptop, i copied the same folder to my desktop system and open in Visual studio 2015, when i try to run the application its suddenly gives following error.
The operation could not be completed. The system cannot find the path specified
Anybody feel same error in your latest Visual Studio 2015? I updated all the latest patches.
following trial are done
Re created the soluition file(.sln)
Deleted Web.config and added new one
Still the error exists, so i cant able to debug or run the application.
(1) Run VS as an admin (or elevated access) and open the solution.
(2) Set up a project as Start up Project (if you have multiple proj)
(3) Set up page as start up page.
this should help you run it
Create manually (Windows Explorer if necessary) a folder with name "Service References". Even if the folder does not appear in the Solution Explorer, is there.
Try adding the wsdl (xml) file again.
I had the same problem, resolved by creating a Connected Services folder in my project.
So juste create a Connected Services folder or a Service References folder in your project
I experienced this error. When I shorten the file path of the solution, the error disappear. I think you may put your solution to a folder with too long path name or your solution have some file with too long name.
I got a more specific project-load error message when I removed the project from the solution and tried to re-add it. In my case, it was because the URL/address of the application had changed in my local IIS. When I updated the tag in the .vbproj (or .csproj) file to the new value, then the project loaded successfully.
in my solution:
i have a class library project that compiles into a dll.
i have a web project.
(i have multiple solutions with different web projects but the same class library)
one of the files in the class project (utilities.cs) - all of a sudden won't compile into the .dll
i had made a change to this file, but the change wouldn't show on the website. so i put a breakpoint in the .cs file, and tried running it... breakpoint didn't get hit! eventually i put a breakpoint in the .aspx file that called the function. then i stepped the debugger one line on, so it would step into the .cs file, except i got the error:
"This source file has changed. It no longer matches the version of the file used to build the application being debugged."
so the code in utilities.cs is not being updated into the dll. which is weird, because code in my other .cs files IS being updated (i tried changing a few lines) and IS able to catch the debug.
any ideas how to fix this? or even what the cause of the problem is??
Try:
Right click on Solution in Solution Explorer -> Properties -> Configuration Properties -> Make sure Build checkbox is checked for your class library.
You need to find out why the DLL will not build:
Look at the output window for any errors
Check the Errors window
Fix the errors and try building again.
The dll that you are trying to debug is from an older version of your code that did compile OK and the debugger pickes that up and is trying to debug against that - it is complaining because the code and the dll no longer match.
Try doing a Build -> Clean on the solution and then rebuilding to see the errors.
When You adding new references to Web project You must choose "Projects" tab:
Projects lists all reusable components created from local projects.
Add or Remove References in Visual
Studio
Add a Reference to a Visual Studio
Project in a Web Site
Always rebuild all projects in Release and Debug mode.
I did exactly what #nightcoder said but a simple change was required. Go to Configuration Properties(Right click on Solution in Solution Explorer -> Properties -> Configuration Properties) and select "All Configurations" in Configuration option.
This created the .dll for me
This happened to me after switching between branches in a project which have significant differences between them, I tried every solution from the web but non worked.
Finally, I had to delete my local project files and clone the project from the GitHub repo again, after that when I started the project, the project build worked without errors, and dll was generated.