Why can't Visual Studio find System.Web.Mvc.resources.dll? - asp.net-mvc-3

I keep getting these 11 errors in Visual Studio:
Error 456 Could not copy the file "_bin_deployableAssemblies\de\System.Web.Mvc.resources.dll" because it was not found. ViMuDat
Error 457 Could not copy the file "_bin_deployableAssemblies\de\WebMatrix.WebData.resources.dll" because it was not found. ViMuDat
Error 458 Could not copy the file "_bin_deployableAssemblies\de\WebMatrix.Data.resources.dll" because it was not found. ViMuDat
Error 459 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.resources.dll" because it was not found. ViMuDat
Error 460 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.Razor.resources.dll" because it was not found. ViMuDat
Error 461 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.Deployment.resources.dll" because it was not found. ViMuDat
Error 462 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.Administration.resources.dll" because it was not found. ViMuDat
Error 463 Could not copy the file "_bin_deployableAssemblies\de\System.Web.Razor.resources.dll" because it was not found. ViMuDat
Error 464 Could not copy the file "_bin_deployableAssemblies\de\System.Web.Helpers.resources.dll" because it was not found. ViMuDat
Error 465 Could not copy the file "_bin_deployableAssemblies\de\NuGet.Core.resources.dll" because it was not found. ViMuDat
Error 466 Could not copy the file "_bin_deployableAssemblies\de\Microsoft.Web.Infrastructure.resources.dll" because it was not found. ViMuDat
I try to build a project that was developed with Visual Studio 2010, but I am using Visual Studio 2012. If I build it twice, it works without errors.
How can I fix that?
I have found Bin Deploying ASP.NET MVC 3 and _bin_deployableAssemblies and MSBuild, but I could not manage to fix those errors. Could somebody please explain step by step what I should do? I am new to C# and Visual Studio.
I think this error is also the problem why I can't Check in the project into a TFS.
I have these assemblies in my bin folder:
D:\...\bin> ls
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 18.12.2012 23:53 de
-a--- 15.12.2012 21:11 783648 EntityFramework.dll
-a--- 15.12.2012 21:11 834489 EntityFramework.xml
-a--- 18.12.2012 23:53 42496 LumenWorks.Framework.IO.dll
-a--- 18.12.2012 23:53 116224 LumenWorks.Framework.IO.pdb
-a--- 18.03.2010 18:31 53640 System.ComponentModel.DataAnnotati
ons.dll
-a--- 18.03.2010 18:31 1328984 System.Data.dll
-a--- 18.03.2010 18:31 919880 System.dll
-a--- 18.03.2010 18:31 24944 System.Web.Abstractions.dll
-a--- 18.03.2010 18:31 2824528 System.Web.dll
-a--- 05.01.2011 14:45 130408 System.Web.Helpers.dll
-a--- 03.05.2012 08:55 37861 System.Web.Helpers.xml
-a--- 05.01.2011 16:42 445280 System.Web.Mvc.dll
-a--- 03.05.2012 08:51 777665 System.Web.Mvc.xml
-a--- 18.03.2010 18:31 24928 System.Web.Routing.dll
-a--- 05.01.2011 14:45 136552 System.Web.WebPages.dll
-a--- 03.05.2012 08:55 51735 System.Web.WebPages.xml
-a--- 18.03.2010 18:31 941904 System.Xml.dll
-a--- 18.12.2012 23:53 244736 ViMuDat.dll
-a--- 18.12.2012 23:53 321024 ViMuDat.pdb
-a--- 18.12.2012 23:53 125308 ViMuDat.XML
D:\...\bin\de> ls
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 12.01.2011 16:04 15720 System.Web.Helpers.resources.dll
-a--- 12.01.2011 17:24 32096 System.Web.Mvc.resources.dll
-a--- 12.01.2011 16:04 15208 System.Web.WebPages.resources.dll

If you are bin deploying MVC 3, there are some assemblies that you have to package up in your deployment. Scott Hanselman has a good write up on what and where as well.
If you have copied the assemblies, make user to add then as 'content' to your Visual Studio project. Then they will be automatically copied into the correct structure in the bin directory when you build.
EDIT:
This was the information in the article that helped solve the problem:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies and
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies contained the missing dlls
Those dlls had to be copied manually to _bin_deployableAssemblies of my project.

You might find it easier to just install the packages via nuget.
NuGet is a package manager which makes it easy to install and update dependencies in your project. It is a Visual Studio extension which can be installed from here.
If you are still using ASP.NET MVC3, you can install an older version of the package by using the command Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1.
This will add the binaries as normal references which are included in the bin folder when your project is built. This will save you having to do the _bin_deployableAssemblies approach. Most other popular 3rd party frameworks (as well as a lot of the new Microsoft Web stack) are also available on nuget.

Related

Docker unable to copy .git folder

When trying to generate a file called head with the current commit hash during a docker build (for internal .NET service versioning) it seems that docker is unable to pull the .git folder into the image at all.
Given the following DockerFile
FROM alpine/git AS version
WORKDIR /src
COPY .git/ ./.git/
RUN git rev-parse HEAD > head
This happens:
=> ERROR [version 2/4] COPY .git/ ./.git/ 0.0s
------
> [version 2/4] COPY .git/ ./.git/:
------
failed to compute cache key: "/.git" not found: not found
What is perhaps more interesting is that when using COPY . . it fails like so:
=> ERROR [version 4/4] RUN git rev-parse HEAD > head 1.7s
------
> [version 4/4] RUN git rev-parse HEAD > head:
#36 1.613 fatal: not a git repository (or any of the parent directories): .git
------
executor failed running [/bin/sh -c git rev-parse HEAD > head]: exit code: 128
The git folder is at the same root as the Dockerfile as ls -Force (windows powershell version of ls -a) the following result is returned (a few folders redacted for privacy):
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/4/2020 2:45 PM .ci
d--h-- 3/17/2021 3:06 PM .git
d----- 2/3/2021 6:12 PM .github
d----- 9/8/2020 7:22 PM .idea
d----- 1/20/2021 1:50 PM .run
d--h-- 9/29/2020 6:53 PM .vs
d----- 3/17/2021 10:55 AM build
d----- 11/4/2020 2:45 PM lib
d----- 9/7/2020 11:12 AM src
d----- 11/4/2020 2:45 PM tests
-a---- 3/15/2021 4:19 PM 340 .dockerignore
-a---- 2/3/2021 6:12 PM 186 .editorconfig
-a---- 2/3/2021 6:12 PM 580 .gitignore
-a---- 3/17/2021 4:07 PM 1611 Dockerfile
Unhiding the .git does not change this behavior.
https://stackoverflow.com/a/54150671/1890717 is a related answer that does not seem to be working here. At least on Windows 10
Check if .git is included in your .dockerignore file and if so, remove it.

What is the purpose of these Visual Studio directories?

In what way are these directories used by Visual Studio?
Get-ChildItem -Path $Env:USERPROFILE\AppData\Roaming\Microsoft\VisualStudio
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2019-12-27 20:24 10.0
d----- 2019-12-27 17:28 11.0
d----- 2020-01-14 08:34 15.0
d----- 2019-12-23 11:52 15.0_52fe5057
d----- 2020-03-24 11:10 15.0_6cf8de10
d----- 2019-12-31 10:10 15.0_6cf8de10Exp
d----- 2020-06-29 16:43 15.0_cffcaa9f
They are folders containing the various preferences of parts of the different versions of Visual Studio you have installed. Looking in mine (I only have VS2019 installed) and guessing based on filenames due to binary data; it contains: the window layouts of VS, Team Explorer previously-configured connection details, Activity logs, auto-recover project backup files, UI layout, and backup User settings.

M2_HOME is set to an invalid directory even when it points to maven installation home

I have set my M2_HOME to
C:\Users\username\Documents\apache-maven-3.5.0
Contents of above directory
09/21/2017 05:13 PM <DIR> .
09/21/2017 05:13 PM <DIR> ..
09/21/2017 05:13 PM <DIR> bin
09/21/2017 05:13 PM <DIR> boot
09/21/2017 05:13 PM <DIR> conf
09/21/2017 05:13 PM <DIR> lib
04/03/2017 08:41 PM 20,934 LICENSE
04/03/2017 08:40 PM 182 NOTICE
04/03/2017 08:36 PM 2,544 README.txt
3 File(s) 23,660 bytes
6 Dir(s) 348,568,027,136 bytes free
However when I run mvn --version in cmd, I get the following error
ERROR: M2_HOME is set to an invalid directory.
M2_HOME = "C:\Users\abhish\Documents\apache-maven-3.5.0"
Please set the M2_HOME variable in your environment to match the
location of the Maven installation
I checked a similar post on SO. However that didnt help, hence posting this question.
I need this solved to solve this problem.
if u are using java 8, please remove "MAVEN_OPTS" from environmental variable and check. because java 8 doesn't support for that config.

Import working cordova project in Visual Studio giving errors

TL;DR
When I'm importing my existing Cordova project in Visual Studio and run the application in my browser (through Ripple) I'll get the following error:
PushPlugin.register - We seem to be missing some stuff :(
Full explanation:
First of all apologies for the long post, I wanted to include as much information as possible!
I have a working Cordova application that I run with Ionic, Cordova and Ripple. I use Ripple to emulate mobile devices in my browser.
All of the features work perfectly when I test it in Sublime Text Editor and run with ripple emulate.
When I try to import the project in Visual Studio, it doesn't run as smoothly.
I'll explain what I did in steps, because perhaps I missed something in a particular step.
Step 1
This is my code from my config.xml in my Sublime project (not Visual Studio).
<gap:plugin name="cordova-plugin-file" source="npm" />
<gap:plugin name="cordova-plugin-file-transfer" source="npm" />
<gap:plugin name="cordova-plugin-device" source="npm" />
<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
<gap:plugin name="com.phonegap.plugins.pushplugin" version="2.4.0" />
This is the config.xml in Visual Studio. Note the com.phonegap.plugins.PushPlugin. This is a plugin available on github, but I could only find a direct link to the 2.5 version. In managed to download the zip to the 2.4 version though, so I added it through this way.
<plugin name="cordova-plugin-file" version="4.1.1" />
<plugin name="cordova-plugin-file-transfer" version="1.5.0" />
<plugin name="cordova-plugin-device" version="1.1.1" />
<plugin name="cordova-plugin-inappbrowser" version="1.2.1" />
<plugin name="com.phonegap.plugins.PushPlugin" version="2.4.0" src="D:\Dev\A\VisualStudioApp\VisualStudioApp\local-plugins\PushPlugin-2.4.0" />
<plugin name="cordova-plugin-websql" version="0.0.10" />
Step 2
This is the folder structure in my Sublime Text Editor:
<DIR> fonts
<DIR> icons
<DIR> images
<DIR> iscroll
<DIR> jquery-mobile
<DIR> js
- <DIR> app
- <DIR> lib
<DIR> platforms
<DIR> res
<DIR> slickgrid
<DIR> styles
<DIR> testdata
27 295 MobileProject.jsproj
588 MobileProject.jsproj.user
4 115 config.xml
999 config.xml.bak
938 config.xml.vs
222 115 cordova.android.js
209 664 cordova.ios.js
60 180 cordova.js
2 cordova_plugins.js
1 142 footer.html
313 header.html
212 index.html
67 607 main.html
And here is the folder structure inside Visual Studio:
<DIR> bin
<DIR> bld
<DIR> local-plugins
<DIR> merges
<DIR> platforms
<DIR> plugins
<DIR> res
<DIR> testdata
<DIR> www
- <DIR> fonts
- <DIR> icons
- <DIR> images
- <DIR> iscroll
- <DIR> jquery-mobile
- <DIR> js
- <DIR> app
- <DIR> lib
- <DIR> slickgrid
- <DIR> styles
- 1 142 footer.html
- 313 header.html
- 212 index.html
- 67 607 main.html
131 .gitignore
75 bower.json
225 build.json
6 686 VisualStudioApp.jsproj
309 VisualStudioApp.jsproj.user
7 146 config.xml
122 package.json
124 250 Project_Readme.html
34 taco.json
Step 3
Run the application on Android
This is what my console log gives me:
GET http://localhost:4400/config.xml 404 (Not Found) ripple.js:51
No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin. whitelist.js:24
Sidenotes
When I add the plugins, but don't copy the code from Sublime to Visual Studio, no errors will be shown.
When I run the application on Windows-AnyCPU (Local Machine), the application will start and almost instantly shut down.
In debug mode I've bumped into an exception at the start of the run:
SCRIPT5022: Unhandled exception at line 59, column 13 in ms-appx://io.cordova.myapp4a33c5/www/cordova.js
0x800a139e - Runtime-fout JavaScript: module cordova/windows8/commandProxy not found
cordova.js (59,13)
What is this cordova/windows8/commandProxy?
(I am assuming you have the correct version of Node installed)
What version of Visual Studio you have? I am using Visual Studio 2015 and here are the steps I have taken to import my projects.
Unzipped it to a place I want my project to be.
On Visual studio menu File --> Open --> Project/Solution and Selected my folder where all the files are.
You will see and upward arrow icon says Dependencies right under your Solution. Expand it and you will see 2 folders Bower and NPM. Right click and Select Restore Package. This might take some time.
After that, try use the command version and use "ionic serve". This should bring it on a webpage.
For your Cordova proxy question, Check the following link out
cordova windows error: “cordova/windows8/commandProxy” not found
Hope this helps.
Take a look at my answer here. Although it's not the exact same error message, the problem is the same.
Ripple is not a complete simulation of a real device, there is no support for many plugins, such as the PushPlugin you're using. Try running your app on a real device or an emulator to fix the error.

VSCode Installation Failed - Failed to extract installer

VSCodeSetup.exe
Installation has failed
Failed to extract installer
I am unable to install or open up the Setup Log.
Trying to install on Windows 8.1 Enterprise
I just downloaded VSCodeSetup.exe and the installation failed with an error dialog when I ran it on Windows 7.1 SP1.
I then right clicked on the VSCodeSetup.exe file and used 7Zip to extract the archived files to a VSCodeSetup folder, with the resulting files:
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 4/22/2015 8:28 AM 140782 background.gif
----- 4/27/2015 6:22 PM 60255967 Code-0.1.0-full.nupkg
----- 4/27/2015 6:22 PM 74 RELEASES
-a--- 4/30/2015 9:25 AM 1911 SquirrelSetup.log
----- 4/24/2015 11:12 AM 1492992 Update.exe
I then opened PowerShell (a CMD window would also work). I cd'd into the VSCodeSetup folder and ran the following command:
PS>.\Update.exe --install=.
Installation completed successfully and Visual Studio Code opened.
Hope this helps.
Rick

Resources