ASP Cannot read configuration file in vmware shared folder - asp.net-mvc

I have problem in my development machine. I've put the development inside vmware with all my project files in the vmware shared folder but when I try to run my asp mvc project, it results in the error:
"Cannot read configuration file" and "Config file:
\?\Z:\Work\Shared\Dev2\workspace\projects\Test\WebApplication1\WebApplication1\web.config".
I've read many blogs that recommend changing the file permission, but nothing works. Can anyone help?
I use Windows 7, Visual Studio 2013 and IIS express to run the project.
Thanks in advance,
Reynaldi

Related

Docker GetServiceReferences: The given path's format is not supported

Trying to run locally a Web MVC application using Docker. Application compiles and runs fine when Set as StartUp Project outside of the docker-compose project but fails when docker-compose is Set as StartUp Project during the build when it comes to Target DockerGetServiceReferences: with
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(195,5): error : The given path's format is not supported.
I have added the docker-compose through Visual Studio 2017 to an existing application as described here:
How to containerize the .NET Framework web apps with Windows Containers and Docker
I appreciate this might be quite vague so if there are any more details I could provide please let me know.
EDIT:
Adding docker-compose to just default MVC template in a new project works fine so the problem seems to be with the legacy solution. Also noticed I can't navigate docker-compose project General Properties, I get the URI formats are not supported popup error
EDIT:
Adding a brand new MVC project from the template to the solution without any references to other projects also generates the error. Could this indicate that the problem might be somewhere on the solution level?
EDIT:
I have created a new Solution file and started to migrate all the projects. This way I am successfully able to compose docker image. Once I am finished migrating all of the project I will do a comparison on .sln files and try to see what is different.

Deploying ASP.Net website in VPS (windows server 2012)

I've recently bought a VPS in which I wanna host a website. When I waana upload an ASP.Net MVC website in a normal shared hosting, I simply use the the publish option in the visual studio and the website gets automatically uploaded in the host. In the VPS which has Windows server 2012, there is a server manager which I used to create an area in the hard drive where I have to put my web file. (I put a hello world html file and it works)
My question is that, I have never manually uploaded an ASP.Net application before and I do know how exactly Visual Studio publish those ASP.Net website, so how can I manually build the website and put it in the VPS.
I used the batch build, VS made some Dlls and I don't know what to do with them .
If you call MS build from the command line in the following manner for instance:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe TestApp.csproj /p:Configuration=Release /t:Package
by specifying the target "Package" (/t:Package) you are commanding MSBUILD to package the website.
It will proceed to build and package your website into an MSDEPLOY package (specific zip file layout).
The build output from the sample build is actually very helpful and gives you clues as to where to go next, for example it tells us where it created the file:
Package "TestApp.zip" is successfully created as single file at the following location:
file:///C:/TestApp/obj/Release/Package
It also gives us a link to find out more:
To get the instructions on how to deploy the web package please visit the following link:
http://go.microsoft.com/fwlink/?LinkId=124618
Then it shows you where it created a sample .cmd file for deploying the package
Sample script for deploying this package is generated at the following location:
C:\TestApp\obj\Release\Package\TestApp.deploy.cmd
For this sample script, you can change the deploy parameters by changing the following file:
C:\TestApp\obj\Release\Package\TestApp.SetParameters.xml
Now you can customize the ".deploy.cmd" file to publish your application on your server. Edit the ".SetParameters.xml" file to setup specific parameters for your server. Login into your server, run the command file from a console that has right to publish and all should be good.

Error after installing TFS 2012 - Update 2

I have one TFS 2012 environment with Update 1 and today I updated this environment to Update 2, the installation is completed with sucess, but my portal web access is not working and is returning the bellow error
Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Before the update, my environment was running smoothly but now after the installationd Updete 2 is not working
This error is about ASP NET MVC, all right?
Can you help me?
I did not installed update 2 yet myself but did you check your administration console? And check also your event viewer, maybe you'll find interesting information/errors there that can help you out.
I've installed update 2 but haven't encountered the issue you have. I did have some issues and ended up turning off the application pools for the Portal and disabling TFS on the server by using the TFSServiceControl quiesce command before installing the update.
One thing I have noticed is that TFS Update 2 installs a .Net 4.0 version of 'System.Web.WebPages.Deployment' into the GAC an the location:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_2.0.0.0__31bf3856ad364e35
Assuming you are running x64 there is a .Net 2.0 version of this assembly in
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies
Alternatively for x32 it should be in
C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies
I would suggest copying the .Net 2.0 version of this DLL from this location to the TFS Portal's bin folder and seeing if this resolves the issue.
This looks like a classic hunt and peck from the old days. I have no idea what types of installations this affects, but mine was a 2008 x64. Basically, I went to the web.config of the team (program files, long path, 11.0, web...\bin) and enabled error reporting.
Then I loaded it with IE in localhost addressing to get to the team project. Basically, it's looking for a bunch of .NET 2.0 DLLs. Copy each one it is looking for (find them doing a dir /s off the root, there are a few) to the local bin folder.
Thought these days had passed. Hope this helps someone.
I had exactly the same problem after upgrading TFS2012 RTM to update 4.
I was able to resolve the problem by amending the user of the Application Pool to a TFS Administrator user (it was set as Network Service I think).

Simulating remote environment?

I'm building a .NET MVC application which will be deployed on a Windows 2003 server. The server has a folder # c:\Website\Files which needs to be written to from the application.
How do I cope with this in my development environment so that the MSI setup file, which I will compile, will work correctly when deployed?
p.s. the folder is NOT located in a subdirectory of the application project
I found another implementation. I think this might be a obsolete question.

Visual Studio 2008 Asp.net MVC and Run as Administrator

In my visual studio asp.net mvc applications I have 4 build configurations; one is to use IIS as the web server, which requires "run as administrator" when running visual studio.
So I ran as admin and created some new files. I have a multi-project template that I use for all my web applications. So I copied the new files from the project I was using back to my template project because they would be useful for all my projects, but didn't think about the "run as administrator" thing.
So now when I create a new project from my template and try to run the asp.net development web server nothing happens, but when a run as administrator the web server loads everything with no problems.
So my question is how can I remove the "run as administrator" requirements from all the files and folders, and I really don't know which files were added, there were many? I have to remove the administrator requirement because many people maintain the code besides me after its in production. Do I need to just recreate the entire project template?
I am using VS 2008 sp1, Windows 7 RC
The Run As Administrator requirement for VS is based on it requiring access to IIS, if I remember correctly, not the files themselves.
People on other machines that don't have this level of UAC protection, say Windows XP, should not have this problem.
The problem is very likely that some of the files are owned by an administrative user and cannot be overwritten by non-administrative users. The ACLs on the files likely need to be updated. One way to do this is to right-click Properties on every file, go to the security tab, and add the appropriate users/groups with the appropriate permissions to each file (probably try to match the files that already exist and have correct permissions).
There is a command line tool called CACLS (more info here and here) that can do this much more quickly, but it's non-trivial and you don't want to screw it up. You would run CACLS as the owner of the directory or the administrator to grant permissions to non-administrators.
Here's an example that gives user "Michael" full control to the SQL Server data directory and all subdirectories and files:
CACLS C:\SQLData\MSSQL$INSTANCE1 /T /E /G Michael:F
Please note that I have no experience with Windows 7. ACLs have been around since the first version of Windows NT and I'm assuming nothing changed radically in Windows 7.

Resources