Within Visual Studio, I use Web Deploy.
Within the settings, it asks for 4 fields to be filled one (and 1 optional)
I am guessing, behind the scenes, it is calling msdeploy.exe and passing them as command line arguments
I'm struggling to map these across as I want to use
shell: cmd
run: '"C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/msdeploy.exe"
-verb:sync
-allowUntrusted
-source:contentPath="%CD%\myDomain.Ui\bin\Release\netcoreapp3.1\"
-dest:contentPath=domain,computerName="<server>:443/msdeploy.axd?site=<site name>",username="<user name>",password="<password>",authtype="Basic"'
As you can see, source:contentPath uses the actual path and this works fine in GitHub actions. I'm having issues with the dest: part. In the example above, I've used the titles (so instead of myUserName, I've used as it shows in the screenshot)
I have 2 questions.
When I click "publish" within Visual Studio, if it really is just calling msdeploy.exe, then is it possible to show this in the output. If I knew how to do that, I may be able to answer my own question
Have I mapped them correctly
As for how to see more details, this KIND OF works:
Visual studio 2017 Verbose publish
The relevant part is
To change the amount of information included in the build log On the menu bar, choose Tools, Options.
On the Projects and Solutions page, choose the Build and Run page.
In the MSBuild project build output verbosity list, choose one of the following values, and then choose the OK button.
And then, at the very end of the build, search for MsDeploySourceProviderSetting
You can then see the details! This gives some of the values, but not all!! It doesn't really answer the question! However, it got me part way there
It needed to be
-dest:contentPath=<site name>,computerName="<server>:443/msdeploy.axd?site=<site name>",username="<user name>",password="<password>",authtype="Basic"'
EG, my website ULR is https://example.com and in IIS, it is set up as MyWebsite
-dest:contentPath=<MyWebsite>,computerName="https://examplecom:443/msdeploy.axd?site=MyWebsite",username="<user name>",password="<password>",authtype="Basic"'
Also, if you do use VS as I did, it may give you a different port, so be aware that 443 may not be right!!
Related
I am using Visual Studio 2012 and HP Fortify 4.21 with the latest rule packs.
The code (C#) lives on the same machine that has HP Fortify and I am only using AWB not SCC. The code successfully builds when the developer does the build, but when I try to scan with Fortify I get an error.
ASP Pre-compilation error
This error happens whether I am launching from VS or from command line. The logs show no errors or warnings, but stating at the end that there is nothing to store, so a fpr file is never created. If I run the scan from Audit Workbench it crashes only stating that it cannot create the build ID.
I did find a suggestion (below) to resolve the ASP issue but it fails and does not create the fpr file to be able to run the last line (to do the scan).
I appreciate any assistance!
Step 1: Clean
sourceanalyzer -b "Build ID" -clean
Step 2: Translation/Build
sourceanalyzer -b "Build ID" -Xmx1280M -Xss8M -debug -logfile trans.log devenv "Sample.sln" /Rebuild Debug
Step 3: Analysis
sourceanalyzer -b "Build ID" -Xmx1280M -Xss8M -debug -logfile scan.log -scan -f Results.fpr
I was running into this issue and this took care of my problem.
Step 1. Click the "BUILD" tab
Step 2. Click "Clean Solution"
Step 3. Most likely two folders appeared in the Solution Explorer (bin and obj). Right click each one and delete it, doesn't matter what order you do it in.
Step 4. Click the "BUILD" tab
Step 5. Click "Rebuild Solution"
Step 6. Try to run FORTIFY again
Extra steps
Step 7. If it still doesn't work check your web.config for errors. The project will build with errors but will cause the precompilation to fail with Fortify.
Step 8. Try allocating more RAM to Fortify by going to HP Fortify -> Options -> Project Settings -> Memory (MB) -> 1024 (or higher).
I've run into similar problems. Try it on another machine. Sometimes that makes it work. When it hasn't it has been due to a Fortify bug. Working with Fortify support has helped me track the problem down. HP files a bug on it though I don't believe it helps. That said, once I know what construct in the file has caused the failure I've been able to modify the file to get Fortify to complete.
Sorry I don't have more help.
The problem is with one or more of your ASPX files. For dotnet web forms the ASPX pages are not compiled by Visual Studio, they are compiled dynamically on the server. In order for Fortify to scan that code, it is calling the ASPNET_compiler to compile your ASPX files. Pass -debug from the command line and then look in the log for a call to ASPNET_compiler. You can copy those arguments and then run them in the Visual Studio command prompt to find the ASPX file that is causing the problem. Keep in mind that when passing ASPNET_compiler a directory to compile, it dies when it finds the first error. You may have to run it a few times to find all of the errors.
Check the Analysis Information Tab in AWB for a related scan error. Also look at the scan log file for a related entry there as well.
If Eric is correct, you may want to put sourceanalyzer into the build script in case the problem re-appears.
step 1. - click "build" tab
step 2. - click "clean solution"
step 3. - 2 folders appeared in solution explorer (bin , obj). right click
each 1 , delete it, doesn't matter order in. step 4. click "build" tab step 5. click "rebuild solution" step 6. try run fortify again
extra steps
step 7. - f still doesn't work check web.config errors. project build errors cause precompilation fail fortify.
step 8. - try allocating more ram fortify going hp fortify -> options -> project settings -> memory (mb) -> 1024 (or higher).
The below link helped to solve my problems.
http://nayviocde12.blogspot.be/2012/08/aspnet-hp-fortify-scans-get-asp-pre.html
Fortify SCA version 16.20 and after
Starting with Fortify SCA version 16.20, ASP.Net code no longer uses the Microsoft aspnet_compiler.exe so this particular issue will not occur again.
Before Fortify SCA version 16.20
My preferred method of debugging precompiler issues is to add this command into the post-build event of the web project in Visual Studio, that way the error shows up in the error list.
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe" -v / -p $(ProjectDir)
Another thing to keep in mind, if you have files that are not part of the solution but are part in the web projects directory, the aspnet_compiler will still read them.
I find this situation common when developers would excluded files from Visual Studio. This does not delete them. Or if they delete them, then delete through the Visual Studio interface but not from the underlying source code repository and they just get downloaded again on checkout.
An easy way to check this would be to turn on Show All Files in the Visual Studio Solution Explorer window.
I Apologize if this question has already been asked. i can't seem to find it anywhere if it has.
I have a custom build script use to syntax check some php files and upload them to a server, and this is executed as a part of the build process. since this script is used to parse inline php statements (embedded in objective c blocks using macros) it's fairly critical this script happens on each build. the actual execution is working fine, i'd just also like to be able to open a particular file when there is an error, and locate the cursor in the approximate location.
i have found that since xcode is configured on my system to open .php files by default (not sure if that's the norm or if i did it manually at some point), using
open filename.php
in a shell script opens the file.
i'd like to be able to specify the line number too.
eg something along the lines of
open filename.php --args --jump-to-line 1234
(--args is a switch for "open" meaning pass the arguments on to Xcode)
any ideas?
You can use the xed command. Only works for Xcode 3 though, not other editors. For Xcode 4, try this
See man xed
We have a number of config transforms which enable us to publish to a particular environment with the correct options specified in web.config.
However, it would be useful to run the application locally while specifying a particular build configuration. This would enable us to run the app locally and have it connected to the live database, for example - quite handy when tracking down bugs, for example.
However, when we press F5 to run the app locally, regardless of the build configuration currently selected, no transform of the web.config file appears to occur.
Is this the normal behaviour and is it possible to change it?
Reposted from comment:
Yes, it is the normal behaviour. It's a nuisance because it makes the whole thing feel half-a-job-ish and I agree there should be the option to opt-in for the same transformations being applied during a standard build. I haven't found any VS extensions that can do this for you yet, though I imagine it could be done. I personally make a ".Local" version of all my build configs and publish to a local IIS which I can attach to very quickly/easily if I want to use a diffferent environment/config's web.config. Requires some duplication, but does the job
Thanks David
I have a problem debugging a web forms application that is configured to use IIS for debugging, under Windows 7 and Visual Studio 2010. An example has just occurred, where I make a change to the code behind for a web form, save, and apparently rebuild before starting the app using F5.
The app starts, and I get an error message trying to do something in the app. I tell the debugger to break when an exception is thrown and try my task again, only to be told
The source file is different from when the module was built.
where the module is C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\9d7b45ca\11a98b19\assembly\dl3\5e6cf0b2\636409d4_dfeecb01\PerfixEMS_Admin.DLL
The physical folder for my test web site is set to the web application project's source folder, so I have always assumed that IIS will look in the bin folder for required assemblies, and these will be rebuilt as expected. Why is this not happening?
Cleaning the solution usually works for me.
Update
Given the high number (320) of projects I understand why Clean and Build won't work for you. You should however try it at least once to see if fixes things.
If it does fix your problem but doesn't last you'll need to do one of two things.
Clean just the one file
Delete the offending temp file. You probably won't be able to do this because with VS running since it may have a lock on the DLL. You may also have to stop IIS. You can use Process Explorer to look for the processes that have a lock.
Use a custom solution
Its unlikely that you're going to be modifing all 320 projects at the same time. Create a custom solution for just the projects you're working on. You'll still be able to step through any project you have the DLL and PDB for if you need to.
Which to do
Using a custom solution has its problems since you can no longer use project reference for projects not in your solution. This impacts your team's source control. You'll also have to make sure the DLL's and PDB's from outside your solution are in a stable location and you'll need a way to detect when thoes other projects have changes that you care about.
These problems can be overcome with a careful check-in process for Project changes and scripts that copy files and working with team members to figure out how to communicate changes.
On the other hand closing VS for every change or running Clean and build isn't really tennable either.
it may be a workaround, but I just need to see if it will work or not, then we may investigate more in the original case. but for now, try this:
1- publish this website to a different folder
2- open the newly published version from your preferred browser (ex: http://localhost/APP_NAME).
3- from VS, open "Debug" menu, choose "Attach to process..."
4- select the IIS worker process "w3wp.exe" and click "Attach".
(if you can't find it, make sure that the checkbox "show processes in all sessions" is checked)
5- start debugging your source code normally and let me know what happened, thanks.
Ok.. I have looked through this site and just can't seem to find the answer I am looking for.
We have a multi server setup for our web sites, typically (DEV/QA/PRODUCTION). Our sites are .net which require some sort of build before being deployed. We are using SVN for source control and are looking for a tool/website/something that will allow our project managers to push button deploy changes to the different environments. It seems there is no silver bullet for this, am I correct in this assumption?
I like the functionality of Springloops but can't find any information regarding its use with .net. Sparing details, it would be nice to see a diagram of sorts on the whole end to end process. What I mean by that is, if multiple different tools are the only answer (no silver bullet), then a diagram that shows where the tools sit in relation to the whole process.
Look at CruiseControl.Net. It'll let you automate your builds and if there are errors it can notify certain people and even flash a big red light in the office.
The other thing it can do is automatically deploy to a chosen region such as Dev/Test/Stage/Prod when there are no errors.
Though you may want to make Prod a manual press of a button. :)
The new on click publishing features in Visual Studio 2010 are pretty easy to set up ans use: http://vishaljoshi.blogspot.com/2009/05/web-1-click-publish-with-vs-2010.html
Supports configuring IIS and deploying SQL packages too.
There is a msdeploy.exe file included in the that you could setup to run with .bat files or some configurable script runner.
Try ClickOnce deployment. Once a update is deployed on the server the client applications are automatically get updated on every client on their next run.