I am developing an asp.net application on macOS with Visual Studio for Mac, and I can specify a custom run configuration.
There seems to be no way to specify a run profile, where all arguments and settings in the custom configuration are saved, instead of reentering command line arguments every time.
Is there a way to do this easily in VS for Mac? Or is that feature not available yet...
No, unfortunately you can't save it but there is workaround for this.
You get the args in the main, just change it to your configuration and put it to code when you need it.
string[] args = new[] {..}
Related
Currently I installed a Mac pipeline agent without android tools, because I intended to use it for iOS only. My question is how to filter the Xamarin.Form solution not to build Android because it fails on this environment.
I'm wondering if there is a way for exclude the android part in the Build Xamarin azure task. I'm asking a way of doing it through: msbuild /t:restore;build /avoid:Android.csproj;Android.Binding.csproj or something alike...
in VS Mac (should be similar, but possibly with different menu paths, on PC) select Solution --> Options in the Solution Explorer. Under Build/Configurations create a new config (or copy an existing one). Then select Configuration Mappings, select the config you just created, and Disable the projects that you want to exclude.
When setting up your build pipeline you should have to specify which configuration you want to use.
DEVENV.exe command I am using to create build.In case solution file has issues and not properly linked to setup project .It throws error "Invalid project " error.Then it opens DEVENV.exe 's switch -help window .
"%dotNet2010%\devenv.exe" MyApp.sln /build "Release" /project "MayApp\Setup.vdproj" /Out "%LOGLOCATION%"
I guess ,This is causing long wait during automatic run and the log file not updated completely.
Any idea ,How to stop this help windows during errors?
As per the below link There is a known issue with DEVENV 2010 command.
http://connect.microsoft.com/VisualStudio/feedback/details/724272/devenv-hanging-on-cmd-line
To fix - We need to upgrade to VS2012 or hot fix need to be applied.
The hang is not happening always.
But with VS2012 devenv command - No hang and error is logged properly.
If you want to suppress all GUI windows and instead have all output redirected to the console then use DEVENV.COM instead of devenv.exe. Note the .COM extension.
For build related tasks it is recommended that you use MSBuild see MSDN Microsoft.
Here is an example of using MSBuild to build Deployment or Setup projects.
Building Visual Studio Deployment Projects With MSBuild
In either case ensure your call is to DEVENV.COM instead of DEVENV.EXE.
I just want to try OpenCover to get Coverage statistics from my app.
But I don't understand well how to use it. So here my questions?
Does the dll's have to be in the same directory? (my solutions have several projects)
Any example to get Coverage using OpenCover?
Is necessary to run the site in IIS Express or with ASP.NET development server is ok?
Thanks a lot!
I set up open cover as an external tool to make it easier on me.
Download the exe and drop it in a folder with as short a path as possible. then setup and external tool as follows:
Title : Open Cover {this is your choice}
Command: {your path to opencover}\OpenCover.Console.exe
Arguments: -register:user -target:"C:\Progra~1\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" -targetargs:"$(TargetName)$(TargetExt)" -output:coverage.xml -targetdir:"$(ProjectDir)\bin\debug"
Initial directory: $(TargetDir)
Set it to use output window and close on exit. You will need to adjust the test runner program to suit you, i use vs2012, if you do too, that will make it easier on you.
To use it, click your test project in your solution explorer, then click on the open cover external tool and it will generate you the coverage report. I use it with Report Generator.
Set it up as an external tool too:
Title: Report Generator
Command: {Your path to report generator}\ReportGenerator.exe
Arguments: $(TargetDir)coverage.xml $(TargetDir)\coverageResults
Again, set to close on exit and use output window.
after generating your coverage report, you can then use report generator to create a nice looking html version that you can click through and see the stats.
hth
The docs that are installed alongside OpenCover carry a lot of useful information about running OpenCover. You should have a copy of this file https://github.com/sawilde/opencover/blob/master/main/OpenCover.Documentation/Usage.pdf in you download package (MSI/ZIP/NUGET)
The DLLs do not need to all be in the same directory but you will normally find that this happens due to the build process. Any assemblies that you want to gather coverage from will require that the PDBs for those assemblies to be in the same directory as the assembly or in the folder referenced by targetdir switch.
Yes you can use it to run iisexpress or the ASP.NET development server use the target switch.
This seems to be happening on a project-by-project basis. Currently I am working on an ASP.NET 4.5 Web Application Project. Intellisense was fine one day but not the next. I am using a custom project template but that should make no difference. I tried editing the text editor settings so that Auto list members and Parameter information are both checked. I tried to reset your Visual Studio settings (Tools --> Import and export settings --> Reset all settings) and I also tried the solution in the accepted answer here:
Intellisense not working
Has anyone got any insight or suggestions? Pending any answers, I've submitted a Connect bug report: https://connect.microsoft.com/VisualStudio/feedback/details/766891/intellisense-broken-in-vs-2012-rtm
You may be able to refresh Intellisense cache with Ctrl + Shift + R (on standard shortcut keys)
I've had the same issue on VS2010 and fixed it another method described at How to turn IntelliSense on in Visual Studio 2010?
From the link:
Delete the files in this folder: %AppData%\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas (the 10.0 folder may be a different number for VS2012)
If nothing else works, you type this in the Visual Studio Command Prompt (this is in your Start menu) and hit enter: devenv /resetuserdata
This last option is documented here on MSDN, with the following disclaimer:
Disclaimer: you will lose all your environment settings and
customizations if you use this switch. It is for this reason that this
switch is not officially supported and Microsoft does not advertise
this switch to the public (you won't see this switch if you type
devenv.exe /? in the command prompt). You should only use this switch
as the last resort if you are experiencing an environment problem, and
make sure you back up your environment settings by exporting them
before using this switch.
I am working on building a new build box which I would like to contain only bare bones essentials for .NET builds. I have installed the .NET 4.0 framework and now I would like to set up a command prompt that recognizes the msbuild command.
I've tried copying over the Visual Studio Command Prompt from my machine but it is missing a lot of prereqs to initialize properly and I feel like it includes way to much stuff anyway as all I need is the msbuild command.
So, is there a way to make the windows cmd to recognize the msbuild command through possibly a batch file?
Try adding the framework tools to your Path environment variable.
Default: C:\Windows\Microsoft.NET\Framework64[version number]
It should also run just fine if you use the full path in the command line.
Figured it out, I added the location of the msbuild.exe to my Path system variable and now it works just fine.