Open generated HTML report in post-build event
In the post-build event of my unit test project I run OpenCover and ReportGenerator to get a code coverage report:
del "$(SolutionDir)TestResultsCoverage*.*"
"$(SolutionDir)packagesOpenCover.4.5.1923OpenCover.Console.exe"
-register:user
-target:"$(MSBuildProgramFiles32)Microsoft Visual Studio 12.0
Common7IDEMSTest.exe"
-targetdir:"$(ProjectDir)bin$(ConfigurationName)"
-targetargs:"/testcontainer:"$(TargetPath)""
-output:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-filter:"+[MyProject]* "
$(SolutionDir)packagesReportGenerator.1.9.1.0ReportGenerator.exe"
-reports:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-targetdir:"$(SolutionDir)TestResultsCoverage"
call "$(SolutionDir)TestResultsCoverageindex.htm"
The final step is to open the generated HTML report. With the current call
command it opens the HTML report in my default web browser. But I would like it if the report could get opened within Visual Studio itself.
If and how would I achieve this?
visual-studio post-build-event opencover reportgenerator
add a comment |
In the post-build event of my unit test project I run OpenCover and ReportGenerator to get a code coverage report:
del "$(SolutionDir)TestResultsCoverage*.*"
"$(SolutionDir)packagesOpenCover.4.5.1923OpenCover.Console.exe"
-register:user
-target:"$(MSBuildProgramFiles32)Microsoft Visual Studio 12.0
Common7IDEMSTest.exe"
-targetdir:"$(ProjectDir)bin$(ConfigurationName)"
-targetargs:"/testcontainer:"$(TargetPath)""
-output:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-filter:"+[MyProject]* "
$(SolutionDir)packagesReportGenerator.1.9.1.0ReportGenerator.exe"
-reports:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-targetdir:"$(SolutionDir)TestResultsCoverage"
call "$(SolutionDir)TestResultsCoverageindex.htm"
The final step is to open the generated HTML report. With the current call
command it opens the HTML report in my default web browser. But I would like it if the report could get opened within Visual Studio itself.
If and how would I achieve this?
visual-studio post-build-event opencover reportgenerator
Can you explain what you hope to achieve by the report opening up in Visual Studio rather than in the browser?
– Shaun Wilde
Nov 28 '13 at 7:56
It's for convenience really. When I'm building my project and it completes it will display the build result and coverage report in the same window, rather than switching between VS and the browser.
– Tom van Enckevort
Nov 28 '13 at 8:06
add a comment |
In the post-build event of my unit test project I run OpenCover and ReportGenerator to get a code coverage report:
del "$(SolutionDir)TestResultsCoverage*.*"
"$(SolutionDir)packagesOpenCover.4.5.1923OpenCover.Console.exe"
-register:user
-target:"$(MSBuildProgramFiles32)Microsoft Visual Studio 12.0
Common7IDEMSTest.exe"
-targetdir:"$(ProjectDir)bin$(ConfigurationName)"
-targetargs:"/testcontainer:"$(TargetPath)""
-output:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-filter:"+[MyProject]* "
$(SolutionDir)packagesReportGenerator.1.9.1.0ReportGenerator.exe"
-reports:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-targetdir:"$(SolutionDir)TestResultsCoverage"
call "$(SolutionDir)TestResultsCoverageindex.htm"
The final step is to open the generated HTML report. With the current call
command it opens the HTML report in my default web browser. But I would like it if the report could get opened within Visual Studio itself.
If and how would I achieve this?
visual-studio post-build-event opencover reportgenerator
In the post-build event of my unit test project I run OpenCover and ReportGenerator to get a code coverage report:
del "$(SolutionDir)TestResultsCoverage*.*"
"$(SolutionDir)packagesOpenCover.4.5.1923OpenCover.Console.exe"
-register:user
-target:"$(MSBuildProgramFiles32)Microsoft Visual Studio 12.0
Common7IDEMSTest.exe"
-targetdir:"$(ProjectDir)bin$(ConfigurationName)"
-targetargs:"/testcontainer:"$(TargetPath)""
-output:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-filter:"+[MyProject]* "
$(SolutionDir)packagesReportGenerator.1.9.1.0ReportGenerator.exe"
-reports:"$(SolutionDir)TestResultsCoveragecoverage.xml"
-targetdir:"$(SolutionDir)TestResultsCoverage"
call "$(SolutionDir)TestResultsCoverageindex.htm"
The final step is to open the generated HTML report. With the current call
command it opens the HTML report in my default web browser. But I would like it if the report could get opened within Visual Studio itself.
If and how would I achieve this?
visual-studio post-build-event opencover reportgenerator
visual-studio post-build-event opencover reportgenerator
asked Nov 27 '13 at 20:39
Tom van EnckevortTom van Enckevort
4,02212039
4,02212039
Can you explain what you hope to achieve by the report opening up in Visual Studio rather than in the browser?
– Shaun Wilde
Nov 28 '13 at 7:56
It's for convenience really. When I'm building my project and it completes it will display the build result and coverage report in the same window, rather than switching between VS and the browser.
– Tom van Enckevort
Nov 28 '13 at 8:06
add a comment |
Can you explain what you hope to achieve by the report opening up in Visual Studio rather than in the browser?
– Shaun Wilde
Nov 28 '13 at 7:56
It's for convenience really. When I'm building my project and it completes it will display the build result and coverage report in the same window, rather than switching between VS and the browser.
– Tom van Enckevort
Nov 28 '13 at 8:06
Can you explain what you hope to achieve by the report opening up in Visual Studio rather than in the browser?
– Shaun Wilde
Nov 28 '13 at 7:56
Can you explain what you hope to achieve by the report opening up in Visual Studio rather than in the browser?
– Shaun Wilde
Nov 28 '13 at 7:56
It's for convenience really. When I'm building my project and it completes it will display the build result and coverage report in the same window, rather than switching between VS and the browser.
– Tom van Enckevort
Nov 28 '13 at 8:06
It's for convenience really. When I'm building my project and it completes it will display the build result and coverage report in the same window, rather than switching between VS and the browser.
– Tom van Enckevort
Nov 28 '13 at 8:06
add a comment |
3 Answers
3
active
oldest
votes
I have actually got it to work using PowerShell and the Navigate
method in the VS core automation wrapper, EnvDTE.
I replaced the last call
command with the following:
powershell
-ExecutionPolicy Unrestricted
-Command "& { $dte = [System.Runtime.InteropServices.Marshal]::
GetActiveObject("VisualStudio.DTE.11.0");
$dte.ItemOperations.Navigate(
"$(SolutionDir)TestResultsCoverageindex.htm"); }"
And that opens the report in a new browser tab inside the VS project.
As an FYI for people trying this with Visual Studio Express (Web Developer), replaceVisualStudio.DTE.11.0
withVWDExpress.DTE.11.0
.
– Tom van Enckevort
Nov 28 '13 at 20:21
add a comment |
Very simple thing worked for me in post build event-
start http://localhost/MYWeb/Home.aspx
add a comment |
You might be able to use devenv to open the file using the command line switches.
devenv /edit $(SolutionDir)TestResultsCoverageindex.htm
but it may open it up as a file to edit rather than to view.
Your last comment is correct, it does open the file in edit mode, rather than browse mode.
– Tom van Enckevort
Nov 28 '13 at 12:43
That gives the edit mode, not viewing mode. Plus if you run devenv inside post build event you getexited with code 9009
message.
– hardywang
Jul 3 '14 at 16:00
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20252655%2fopen-generated-html-report-in-post-build-event%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have actually got it to work using PowerShell and the Navigate
method in the VS core automation wrapper, EnvDTE.
I replaced the last call
command with the following:
powershell
-ExecutionPolicy Unrestricted
-Command "& { $dte = [System.Runtime.InteropServices.Marshal]::
GetActiveObject("VisualStudio.DTE.11.0");
$dte.ItemOperations.Navigate(
"$(SolutionDir)TestResultsCoverageindex.htm"); }"
And that opens the report in a new browser tab inside the VS project.
As an FYI for people trying this with Visual Studio Express (Web Developer), replaceVisualStudio.DTE.11.0
withVWDExpress.DTE.11.0
.
– Tom van Enckevort
Nov 28 '13 at 20:21
add a comment |
I have actually got it to work using PowerShell and the Navigate
method in the VS core automation wrapper, EnvDTE.
I replaced the last call
command with the following:
powershell
-ExecutionPolicy Unrestricted
-Command "& { $dte = [System.Runtime.InteropServices.Marshal]::
GetActiveObject("VisualStudio.DTE.11.0");
$dte.ItemOperations.Navigate(
"$(SolutionDir)TestResultsCoverageindex.htm"); }"
And that opens the report in a new browser tab inside the VS project.
As an FYI for people trying this with Visual Studio Express (Web Developer), replaceVisualStudio.DTE.11.0
withVWDExpress.DTE.11.0
.
– Tom van Enckevort
Nov 28 '13 at 20:21
add a comment |
I have actually got it to work using PowerShell and the Navigate
method in the VS core automation wrapper, EnvDTE.
I replaced the last call
command with the following:
powershell
-ExecutionPolicy Unrestricted
-Command "& { $dte = [System.Runtime.InteropServices.Marshal]::
GetActiveObject("VisualStudio.DTE.11.0");
$dte.ItemOperations.Navigate(
"$(SolutionDir)TestResultsCoverageindex.htm"); }"
And that opens the report in a new browser tab inside the VS project.
I have actually got it to work using PowerShell and the Navigate
method in the VS core automation wrapper, EnvDTE.
I replaced the last call
command with the following:
powershell
-ExecutionPolicy Unrestricted
-Command "& { $dte = [System.Runtime.InteropServices.Marshal]::
GetActiveObject("VisualStudio.DTE.11.0");
$dte.ItemOperations.Navigate(
"$(SolutionDir)TestResultsCoverageindex.htm"); }"
And that opens the report in a new browser tab inside the VS project.
answered Nov 28 '13 at 14:01
Tom van EnckevortTom van Enckevort
4,02212039
4,02212039
As an FYI for people trying this with Visual Studio Express (Web Developer), replaceVisualStudio.DTE.11.0
withVWDExpress.DTE.11.0
.
– Tom van Enckevort
Nov 28 '13 at 20:21
add a comment |
As an FYI for people trying this with Visual Studio Express (Web Developer), replaceVisualStudio.DTE.11.0
withVWDExpress.DTE.11.0
.
– Tom van Enckevort
Nov 28 '13 at 20:21
As an FYI for people trying this with Visual Studio Express (Web Developer), replace
VisualStudio.DTE.11.0
with VWDExpress.DTE.11.0
.– Tom van Enckevort
Nov 28 '13 at 20:21
As an FYI for people trying this with Visual Studio Express (Web Developer), replace
VisualStudio.DTE.11.0
with VWDExpress.DTE.11.0
.– Tom van Enckevort
Nov 28 '13 at 20:21
add a comment |
Very simple thing worked for me in post build event-
start http://localhost/MYWeb/Home.aspx
add a comment |
Very simple thing worked for me in post build event-
start http://localhost/MYWeb/Home.aspx
add a comment |
Very simple thing worked for me in post build event-
start http://localhost/MYWeb/Home.aspx
Very simple thing worked for me in post build event-
start http://localhost/MYWeb/Home.aspx
answered Sep 23 '14 at 9:10
user2987600user2987600
9112
9112
add a comment |
add a comment |
You might be able to use devenv to open the file using the command line switches.
devenv /edit $(SolutionDir)TestResultsCoverageindex.htm
but it may open it up as a file to edit rather than to view.
Your last comment is correct, it does open the file in edit mode, rather than browse mode.
– Tom van Enckevort
Nov 28 '13 at 12:43
That gives the edit mode, not viewing mode. Plus if you run devenv inside post build event you getexited with code 9009
message.
– hardywang
Jul 3 '14 at 16:00
add a comment |
You might be able to use devenv to open the file using the command line switches.
devenv /edit $(SolutionDir)TestResultsCoverageindex.htm
but it may open it up as a file to edit rather than to view.
Your last comment is correct, it does open the file in edit mode, rather than browse mode.
– Tom van Enckevort
Nov 28 '13 at 12:43
That gives the edit mode, not viewing mode. Plus if you run devenv inside post build event you getexited with code 9009
message.
– hardywang
Jul 3 '14 at 16:00
add a comment |
You might be able to use devenv to open the file using the command line switches.
devenv /edit $(SolutionDir)TestResultsCoverageindex.htm
but it may open it up as a file to edit rather than to view.
You might be able to use devenv to open the file using the command line switches.
devenv /edit $(SolutionDir)TestResultsCoverageindex.htm
but it may open it up as a file to edit rather than to view.
answered Nov 28 '13 at 8:41
Shaun WildeShaun Wilde
7,02922649
7,02922649
Your last comment is correct, it does open the file in edit mode, rather than browse mode.
– Tom van Enckevort
Nov 28 '13 at 12:43
That gives the edit mode, not viewing mode. Plus if you run devenv inside post build event you getexited with code 9009
message.
– hardywang
Jul 3 '14 at 16:00
add a comment |
Your last comment is correct, it does open the file in edit mode, rather than browse mode.
– Tom van Enckevort
Nov 28 '13 at 12:43
That gives the edit mode, not viewing mode. Plus if you run devenv inside post build event you getexited with code 9009
message.
– hardywang
Jul 3 '14 at 16:00
Your last comment is correct, it does open the file in edit mode, rather than browse mode.
– Tom van Enckevort
Nov 28 '13 at 12:43
Your last comment is correct, it does open the file in edit mode, rather than browse mode.
– Tom van Enckevort
Nov 28 '13 at 12:43
That gives the edit mode, not viewing mode. Plus if you run devenv inside post build event you get
exited with code 9009
message.– hardywang
Jul 3 '14 at 16:00
That gives the edit mode, not viewing mode. Plus if you run devenv inside post build event you get
exited with code 9009
message.– hardywang
Jul 3 '14 at 16:00
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20252655%2fopen-generated-html-report-in-post-build-event%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you explain what you hope to achieve by the report opening up in Visual Studio rather than in the browser?
– Shaun Wilde
Nov 28 '13 at 7:56
It's for convenience really. When I'm building my project and it completes it will display the build result and coverage report in the same window, rather than switching between VS and the browser.
– Tom van Enckevort
Nov 28 '13 at 8:06