nshader icon indicating copy to clipboard operation
nshader copied to clipboard

NShader not working initially in VS2017

Open samizzo opened this issue 7 years ago • 32 comments

Split off from issue #12:

"I just installed NShader in 2017 and had the same problem as Xirema. I got it to work by disabling NShader, restarting Visual Studio, re-enabling Visual Studio and then restarting again."

samizzo avatar Mar 21 '17 01:03 samizzo

Hello, I am also suffering this issue and am unable to get NShader to work on VS2017. It worked well for a while, then it suddenly stopped working. I tried the workaround Xirema suggested and it still doesn't work.

I've followed these instructions to get the activity log, and I found this relevant part of it:

<entry>
    <record>402</record>
    <time>2017/04/02 04:14:53.577</time>
    <type>Warning</type>
    <source>VisualStudio</source>
    <description>Unexpected system error mode before loading package [NShader]</description>
    <guid>{DD9B8CDE-96A0-4442-BF6F-083A7F43D453}</guid>
  </entry>
  <entry>
    <record>403</record>
    <time>2017/04/02 04:14:53.577</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [NShader]</description>
    <guid>{DD9B8CDE-96A0-4442-BF6F-083A7F43D453}</guid>
  </entry>
  <entry>
    <record>404</record>
    <time>2017/04/02 04:14:53.593</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>End package load [NShader]</description>
    <guid>{DD9B8CDE-96A0-4442-BF6F-083A7F43D453}</guid>
  </entry>

(this is the only part of the ActivityLog.xml file that contains any reference to NShader)

I am using the latest version of Visual Studio 2017 (26228.10) on Windows 10 x64. I tried reinstalling a few times and it still doesn't work.

GabrielMajeri avatar Apr 02 '17 04:04 GabrielMajeri

Thanks for the log! So you installed it, it was working, and then suddenly stopped? Did you have any older versions of NShader installed?

I'll try to find some time to look into it this week!

On 2 Apr 2017, at 2:18 pm, Gabriel M [email protected] wrote:

Hello, I am also suffering this issue and am unable to get NShader to work on VS2017. It worked well for a while, then it suddenly stopped working. I tried the workaround Xirema suggested and it still doesn't work.

I've followed these instructions to get the activity log, and I found this relevant part of it:

402 Warning VisualStudio Unexpected system error mode before loading package [NShader] {DD9B8CDE-96A0-4442-BF6F-083A7F43D453} 403 Information VisualStudio Begin package load [NShader] {DD9B8CDE-96A0-4442-BF6F-083A7F43D453} 404 Information VisualStudio End package load [NShader] {DD9B8CDE-96A0-4442-BF6F-083A7F43D453} (this is the only part of the ActivityLog.xml file that contains any reference to NShader)

I am using the latest version of Visual Studio 2017 (26228.10) on Windows 10 x64. I tried reinstalling a few times and it still doesn't work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

samizzo avatar Apr 02 '17 10:04 samizzo

Yes, I installed it, used it for a run or two, and then I opened a GLSL shader and noticed it wasn't working.

I didn't have any previous versions installed.

GabrielMajeri avatar Apr 02 '17 12:04 GabrielMajeri

I've installed the new release and it's fixed. Thanks!

GabrielMajeri avatar Apr 10 '17 03:04 GabrielMajeri

Oh thanks! I hadn't yet looked at this bug and wasn't sure if this would be fixed with the release. I'll do some more testing before I close this though.

samizzo avatar Apr 10 '17 05:04 samizzo

It works for me too after installing the new release of VS2017

ShenyaoKe avatar Apr 11 '17 00:04 ShenyaoKe

Great thanks!

samizzo avatar Apr 11 '17 00:04 samizzo

After installing only the newest version of NShader (v2.4), I also had this issue. I tested NShader while my previous shader extension (HLSL Tools) was disabled. To get NShader working for me, I had to fully uninstall HLSL.

naqaden avatar Apr 20 '17 18:04 naqaden

Thanks for the bug report!

Were you previously running both NShader and HLSL Tools together successfully?

On 21 Apr 2017, at 4:50 am, naqaden [email protected] wrote:

After installing only the newest version of NShader (v2.4), I also had this issue. I tested NShader while my previous shader extension (HLSL Tools) was disabled. To get NShader working for me, I had to fully uninstall HLSL.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

samizzo avatar Apr 20 '17 23:04 samizzo

No problem. I started with only HLSL Tools, then disabled it before installing NShader. I never tried both enabled together.

naqaden avatar Apr 21 '17 00:04 naqaden

Same issue, installed fresh, syntax highlighting does not work.

Rendman avatar Apr 21 '17 02:04 Rendman

Did you get any error messages? Does it show up in Help->About?

What was the extension of the file you opened? How did you open it - via File->Open, or solution explorer, or drag/drop into VS, or some other means?

samizzo avatar Apr 21 '17 03:04 samizzo

No error messages. It does show up as ver 2.4 in Help-About. Extension is .vert (shader.vert), opened via solution explorer and was added by first creating a text file, then naming it shader.vert.

Rendman avatar Apr 21 '17 04:04 Rendman

+1 here, vs2017. .vert and .frag not highlightning

krupitskas avatar May 02 '17 06:05 krupitskas

+1

Hopefully there's no personal data in here. ActivityLog.zip

PazerOP avatar May 14 '17 19:05 PazerOP

Thanks for the info. In the mean time why don't you try Hlsl Tools. It has a lot more features than NShader. Honestly I'm not sure I'm even interested in continuing to support NShader now that Hlsl Tools exists.

samizzo avatar May 22 '17 12:05 samizzo

Unfortunately I'm working with GLSL, so I chose to edit my shader files in VS Code with this extension: https://marketplace.visualstudio.com/items?itemName=slevesque.shader

PazerOP avatar May 22 '17 15:05 PazerOP

Also GLSL user here I'm working with Vulkan, so all my code in glsl

krupitskas avatar May 22 '17 20:05 krupitskas

You should be able to use Hlsl Tools with GLSL files. You can add extra file extensions for it to parse via Tools->Options->Text Editor->File Extension. Although it will complain about various GLSL types that it doesn't know about.

samizzo avatar May 22 '17 22:05 samizzo

I got it to work after disabling the SPIRV-VSExtension by Sascha Willems. Seems like they were conflicting.

Swyter avatar May 26 '17 12:05 Swyter

Had the same problem. I decided to just take Samizzo's advice and adapt HLSL Tools to GLSL. I made a fork and quickly replaced HLSL's types and functions with GLSL ones (all 4.5 functions with parameters and documentations). It is far from a decent job, but it works. Will be maintained depending on available time. https://github.com/ssteinberg/HlslTools

Anyway, thanks to Samizzo for keeping NShader alive, and Tim Jones for HLSL Tools.

ssteinberg avatar May 29 '17 12:05 ssteinberg

Thanks for letting us know about that! The NShader code base is quite old and dates back to VS 2008, and the Visual Studio extension SDK has changed over the years, so I guess that's why we've been having problems. I'll continue to tinker when I have time (working hard to release our game at the moment though!).

samizzo avatar May 29 '17 13:05 samizzo

@ssteinberg what about creating a seperate repo so we can maintain this :smiley:?

realvictorprm avatar Jul 29 '17 16:07 realvictorprm

Unlinked from HlslTools and renamed. If anyone has the time to maintain, please let me know.

https://github.com/ssteinberg/GlslTools

ssteinberg avatar Jul 29 '17 18:07 ssteinberg

Thanks @ssteinberg. Yeah definitely needs maintenance

realvictorprm avatar Jul 29 '17 18:07 realvictorprm

Can you enable that issues can be opened?

realvictorprm avatar Jul 29 '17 18:07 realvictorprm

Done

ssteinberg avatar Jul 29 '17 19:07 ssteinberg

That's great, thanks for doing that!

samizzo avatar Jul 29 '17 23:07 samizzo

Hey guys, I had this problem with the latest release, vanilla install. No biggie though.

Alan-FGR avatar Aug 02 '17 16:08 Alan-FGR

Would like to reiterate what @Swyter said, SPIRV-VSExtension seems to be conflicting/blocking NShader from kicking in.

Markyparky56 avatar Aug 06 '17 19:08 Markyparky56