WebDeploy package contains personal folder path - asp.net-mvc

When I use the Web Deploy Package publish method to publish a ASP.NET MVC website in Visual Studio 2019, the package contains multiple references to my computer and personal folder paths.
For example, the systemInfo.xml file contains:
<systemInfo osVersion="6.3" winDir="C:\windows" machineName="[***MYCOMUTERNAME***]" processorArchitecture="x86" msdeployVersion="1.0" buildVersion="7.1.2606.1250">
And the *.sourceManifest.xml file contains:
<IisApp path="C:\Users\[***MYUSERNAME***]\Source\Repos\myproject\obj\x64\Release\Package\PackageTmp" />
The package still works, but if I want to use this package to distribute the software, how can I build it so that it does not contain personal information?

Web deploy packag always contain the physical path of your project and machine name automatically no matter you generate package from VS or webdeploy. So if you need to hide [MYUSERNAME], please move your project to another path which doesn't contain username.
web deploy package can be pushed remotely so you don't have to worry about the machine name.https://learn.microsoft.com/en-us/previous-versions/aspnet/ff356104(v%3Dvs.110). If you don't want to expose the machine name, you can edit system.info manually.

Related

how to code in Mac for 8thwall web ar and test it?

how to setup 8th wall project for web ar for Mac and use our system instead of using their web editor . I want to code in my computer and test and then upload that to their console rather then coding it in their web editor .
Steps to locally develop 8thwall webAR without using 8th wall cloud editor
Create a project using 8thwall dashboard and navigate to the dashboard settings and copy the appkey.
copy this base glitch get-started project and replace the appkey with your project appkey.
Navigate back to the dashboard and authorize your browser with the help of the dev-token.
You are ready to now use and test 8thwall development locally.
You can later self-host the project instead of copy pasting the code and reformatting according to the 8thwall cloud editor.
You can also directly remix any of the glitch projects as well which is a much quicker option.
NOTE: The glitch projects are under-maintained hence refer docs for latest SDK version as well as syntax changes
You can develop locally by choosing self-hosted project option with 8thwall, then downloading 8thwall's own web repository to tinker with. I struggled with the 8thwall docs to figure this out but the web repository makes locally development pretty straight-forward.
Follow the steps on the getting started guide ,
firstly you'll need to create an 8thwall account and self-hosted project.
Copy your unique App Key from the project settings page.
Clone the source code from the repo, replacing the app key in index.html file with your own app key (this lives in the header of the html file) :
<script async src="//apps.8thwall.com/xrweb?appKey=insert-your-key-here"></script>
8thwall included a serve script, which serves your source code on local network over https. This means you can add your local URL as a trusted domain in your self-hosted project settings for testing.
you'll need to ensure Node.js and npm are installed to run the script
Using the serve script depends on your computer, (there's instructions here for Windows also) but for the case of Mac, open a terminal in your project directory :
cd <to_this_serve_directory>
npm install
cd ..
./serve/bin/serve -d <sample_project_location>
I use Node version 16.16.0 as I had issues with my current node version 18.12.1. You can get Node version manager npm package to help manage your Node versions.
What's great about this is when you run the serve script from your terminal, this generates a QR code so you can test your app on a mobile device over local network. Make sure you copy the entire Listening URL into your browser, including the port number. e.g. https://245.678.0.11:8080
Final thing to mention, don't include the port number in your trusted domains URL. e.g. https://245.678.0.11

TFS Release Task to Deploy a Web Deploy Package to specific directory

I've been digging for hours and i haven't been able to find what i would think is a pretty common scenario.
I am attempting to deploy a Web Deploy Package to my existing Web Site\Web App via a TFS Release. The location of my existing Web Apps is mapped to a different drive. My source code on my web server is not in C:\inetpub lets say its in D:\MyFiles.
I'm open to using any TFS task to do this. It seems like my two options are:
Run Batch Script - point to myApp.deploy.cmd
WinRm IIS Web App Deployment
I've seen lots of examples of overriding the computer name via the setParamater file but I have not seen one example of how to set the target path for the package?
Again, i want to deploy a web package via a TFS release to D:\MyFiles. I've created the package and it deploys locally to c:inetpub, I would assume if I can get it to deploy to a specified Target location locally then when I run that same. CMD file from TFS release it will use that location on the deploy to server.
UPDATE:
So... this just started working. I'm not sure what the issue was but the WinRm Task didn't do the deploy on Friday but did the deploy on Monday. I'm thinking it may have been related to a FQDN for the server path? Honestly I'm not sure what fixed it or what to do with this post? The answer below by #Andy may help someone so I won't delete it. That link is a good one and it showed me how to perform IIS configuration with Web Deploy.
Thanks in advance,
Greg
Seems you are trying to change the physical path of an IIS site/app using MSDeploy.
Just try adding an additional command (appcmd) to the MSDeploy package manifest to change the physical path of the IIS site during the deployment:
<runcommand path="%windir%\system32\inetsrv\appcmd set app /app.name:"Default Web Site/app12" /[path='/'].physicalPath:C:\temp\app12" waitInterval="5000"/>
Refer to this article for details:
WebDeploy/MSDeploy Quick TIP: Change IIS Site/APP Physical Path with MSDeploy

Runtime error when deploying to Azure because of one dll file

I build the app using Visual Studio and already publish it to Azure Services.
However, when trying to run it, I got the following error:
Could not load file or assembly 'RandomColorGenerator.Forms' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I looked into the bin folder in my local project and I can see the dll file just right.
Any suggestions?
According to your description, your MVC project could work on your development environment, but when deployed to Azure Web App, you got the above error. Per my understanding, you could follow the possible approaches below to troubleshoot this issue:
Use KUDU which is an analysis tool for Azure Web Apps, click on the "Debug console > CMD", then check your deployed web content under D:\home\site\wwwroot\. Make sure the missing dll has been deployed to Azure Web App successfully.
You could try to create a new web app for deploying your MVC project, in order to isolate this issue.
Additionally, you could try to empty your deployed web content via KUDU or redeploy your project by select "Delete all existing files prior to publish" under the "Setting > File Publish Options" of VS publish wizard.
UPDATE:
Based on your comment, you are using Azure Cloud Services. You could enable Remote Desktop and re-publish your application, then remote to your cloud services for troubleshooting this issue. Here is a similar issue, you could refer to it.
An attempt was made to load a program with an incorrect format.
As I known, the above message means that there be a 32-bit or 64-bit
platform conflict. For more details, you could refer to this similar issue.

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.

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