Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projectSystem.ArgumentException: Value does not fall within the expected range. #251

Open
ewilli opened this issue Aug 16, 2016 · 29 comments

Comments

@ewilli
Copy link

ewilli commented Aug 16, 2016

Installed product versions

  • Visual Studio: VS2015 Update 3 + all hotfixes
  • This extension: 1.11.319

Description

projectSystem.ArgumentException: Value does not fall within the expected range.

Steps to recreate

  1. open project properties
  2. right-click on project in "Solution Explorer"

Current behavior

Output (no crash):
16.8.2016 11:27:06: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 221
16.8.2016 11:27:06: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 221

Expected behavior

error fixed

@wenz
Copy link

wenz commented Dec 1, 2016

can confirm this behavior for version 1.11.326, as well

@madskristensen
Copy link
Owner

What project type do you see this in? MVC, ASP.NET Core, WebForms...?

@ewilli
Copy link
Author

ewilli commented Dec 2, 2016

Version 1.11.326
Just tested: Windows Forms, MVC, ASP.NET Core, Console.
I think error is project type independent.

@xantari
Copy link

xantari commented Jan 10, 2017

Also getting the error:

1/10/2017 9:57:01 AM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227
1/10/2017 9:57:01 AM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227

@tomchovanec
Copy link

Can confirm on:
VS 2015 Update 3
Version 14.0.25431.01 Update 3
MS .NET Framework 4.6.01586

ASP.NET Core 1.1,

01.02.2017 15:36:06: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227

@bradbamford
Copy link

bradbamford commented Feb 24, 2017

I'm getting this as well in VS 2017 RC
Version: 1.11.326

2/24/2017 10:12:18 AM:
Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227

@kspranesh
Copy link

Hi, Is this error solved. I am getting same problem with Visual studio 2013 Sharepoint Solution, I dont have any css, LESS files in my project but still get the same error. The solution fails immediately when i click on Publish. Please help!

@stevomccormack
Copy link

I'm getting this as well in VS 2017 Professional
Version: 15.1 (26403.7)

I am confident this is causing build issues. I cannot build my projects at all. I need to start/restart/again/again/again until finally somehow the build works. I have been trying to diagnose the root cause for many months now. I had some node errors (around ssh) that I thought may be issue - perhaps causing problems with gulp file locking but I have resolved those issues. The only outstanding error I am getting in VS is this one.

@WILLEM-LENS
Copy link

I had the same problem with VS2017 15.1 Professional with "Web Essentials 2017".
Using Tools -> Reset Web Essentials, the error disappeared.

@LordDelacroix
Copy link

I'm getting this now in a web project in VS 2017 15.2 and yes, Tools -> Reset Web Essentials does fix the error for a time.

@stg609
Copy link

stg609 commented Nov 8, 2017

I had the same problem with VS2017 15.4.2 Community

@blfuentes
Copy link

Same here. VS 2017 15.4.2. ASP Core 2 Web application.

@OsirisTerje
Copy link

Same here,
Visual Studio 2017, 15.5
Console app, with .net FW 4.6.1
image

@alcarcdr
Copy link

Just got this error when creating ASP.NET Core Angular project using;

  • VS 2017 Version 15.5.7
  • .NET Version 4.7.02556

Web Compiler terminal output is below. Hope this might be some help.

11/03/2018 11:36:24 PM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
   at EnvDTE80.DTE2.get_ActiveDocument()
   at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227
11/03/2018 11:36:24 PM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
   at EnvDTE80.DTE2.get_ActiveDocument()
   at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227
11/03/2018 11:38:53 PM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
   at EnvDTE80.DTE2.get_ActiveDocument()
   at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227
11/03/2018 11:38:53 PM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
   at EnvDTE80.DTE2.get_ActiveDocument()
   at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227

@gthvidsten
Copy link

Just experienced this issue in my VS2017. Unfortunately I don't have the Tools > Reset Web Essentials option. Uninstalled and reinstalled the plugin and it started working again.

@LordDelacroix
Copy link

LordDelacroix commented Apr 13, 2018

Ok - thing is with this bug is that it only happens when you don't have an editor window as the active document. If you have a project property window as the ActiveDocument you will see this every time. I believe that's why Mads isn't fixing this one. It's only a problem sometimes and it's certainly annoying but not fatal.

@pgmolloy
Copy link

Just set up continuous delivery, it succeeded. Then a few minutes later this popped up in the output window without any input. Have never seen it before but wanted to add it here to register it. I have latest version of VS 2017, the web app being deployed was simply the templates visual studio web app being deployed to Azure. Here's what the output window display.

2018-05-24 9:35:19 PM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227
2018-05-24 9:35:19 PM: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
at EnvDTE80.DTE2.get_ActiveDocument()
at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227

@blfuentes
Copy link

Same issue here

26.10.2018 13:15:49: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
   at EnvDTE80.DTE2.get_ActiveDocument()
   at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227
26.10.2018 13:15:49: Error getting the active projectSystem.ArgumentException: Value does not fall within the expected range.
   at EnvDTE80.DTE2.get_ActiveDocument()
   at WebCompilerVsix.ProjectHelpers.GetActiveProject() in C:\projects\webcompiler\src\WebCompilerVsix\Helpers\ProjectHelpers.cs:line 227

VS 2017 15.8.8
Web Compiler 1.12.394
Project Type: ASP.NET Core Angular.

@JerrodV
Copy link

JerrodV commented Nov 13, 2018

I was able to get around this issue by cleaning the solution, then deleting the contents of the projects obj folder.

GL

@OzBob
Copy link

OzBob commented Feb 5, 2019

Issue present in VS 2017 Prof 15.9.6 and WebCompiler 1.1.2394
Cleaning the solution, then deleting the contents of the projects obj folder, has helped.

@chassq
Copy link

chassq commented Aug 12, 2019

Issue present in VS 2019 v16.3.0 preview 1

@breket
Copy link

breket commented Mar 11, 2020

16.4.6 aswell

@kevinbroit
Copy link

Ok - thing is with this bug is that it only happens when you don't have an editor window as the active document. If you have a project property window as the ActiveDocument you will see this every time. I believe that's why Mads isn't fixing this one. It's only a problem sometimes and it's certainly annoying but not fatal.

Thanks for your comment! Once you set the active document, its possible compile the file and latter you are able to compile all files from the solution.

@abdelrhmanwahba
Copy link

Ok - thing is with this bug is that it only happens when you don't have an editor window as the active document. If you have a project property window as the ActiveDocument you will see this every time. I believe that's why Mads isn't fixing this one. It's only a problem sometimes and it's certainly annoying but not fatal.

Thanks for your comment! Once you set the active document, its possible compile the file and latter you are able to compile all files from the solution.

please, how did you do that,cause I don't know what is active document or how to do it

@kevinbroit
Copy link

Ok - thing is with this bug is that it only happens when you don't have an editor window as the active document. If you have a project property window as the ActiveDocument you will see this every time. I believe that's why Mads isn't fixing this one. It's only a problem sometimes and it's certainly annoying but not fatal.

Thanks for your comment! Once you set the active document, its possible compile the file and latter you are able to compile all files from the solution.

please, how did you do that,cause I don't know what is active document or how to do it

it’s active when you double click on a file from the solution explorer.

Ok - thing is with this bug is that it only happens when you don't have an editor window as the active document. If you have a project property window as the ActiveDocument you will see this every time. I believe that's why Mads isn't fixing this one. It's only a problem sometimes and it's certainly annoying but not fatal.

Thanks for your comment! Once you set the active document, its possible compile the file and latter you are able to compile all files from the solution.

please, how did you do that,cause I don't know what is active document or how to do it

it’s active when you double click on a file from the solution explorer.

@abdelrhmanwahba
Copy link

Ok - thing is with this bug is that it only happens when you don't have an editor window as the active document. If you have a project property window as the ActiveDocument you will see this every time. I believe that's why Mads isn't fixing this one. It's only a problem sometimes and it's certainly annoying but not fatal.

Thanks for your comment! Once you set the active document, its possible compile the file and latter you are able to compile all files from the solution.

please, how did you do that,cause I don't know what is active document or how to do it

it’s active when you double click on a file from the solution explorer.

Ok - thing is with this bug is that it only happens when you don't have an editor window as the active document. If you have a project property window as the ActiveDocument you will see this every time. I believe that's why Mads isn't fixing this one. It's only a problem sometimes and it's certainly annoying but not fatal.

Thanks for your comment! Once you set the active document, its possible compile the file and latter you are able to compile all files from the solution.

please, how did you do that,cause I don't know what is active document or how to do it

it’s active when you double click on a file from the solution explorer.

i doubled click and the issue not solved

@zacuke
Copy link

zacuke commented Oct 19, 2020

On creating a new project I see this in my Output:
image

@LordDelacroix
Copy link

If you read this thread, you will note that Mads has no intention of fix this after all this time. Personally, I do not blame him although it would appear to be as simple a fix as trapping for that exception (which clearly he does) and ignoring it. The direct CAUSE of this exception is due to the fact that you do NOT have a valid document in focus at that moment. This is partly due to the fact that you are creating a new project and therefore CAN NOT have a valid document in focus at that moment. Therefore ignoring it is acceptable - I do appreciate the fact that it is logged however and you may safely ignore this error message.

@mushu999
Copy link

Note that it is still an issue in VS2019 and not just on new projects as stated above, but every time you publish something, ostensibly due to the Publish tab always being the active tab in the window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests