Avatar of Tom Knowlton
Tom Knowlton
Flag for United States of America asked on

Referencing a WSDL file generates large References.cs file in Visual Studio. Options for dealing with this large file?

My References.cs file (generated by my recent addition of a third party WSDL reference) is very large.  664,293 lines.  Often when I open the file, the Visual Studio 2019 IDE crashes and re-opens.

I guess I am taxing my Windos 10 OS by opening the file?

In Task Manager, CPU % usage jumps when I scroll the file.  So does RAM usage.  I can clearly see that the file is impacting my system.

But my question is not IF the file is large, but what to do about it?

Can the file be compiled somehow, so I still have access to the web methods in the WSDL without having to actually OPEN the References.cs file?  I mean, I know I don't have to OPEN the References.cs file in order to reference the methods, but I can't just delete the file, right?  I want to compress it or compile it or do something so it reduces the impact on my system.
.NET ProgrammingOperating SystemsMicrosoft Visual StudioC#

Avatar of undefined
Last Comment
Tom Knowlton

8/22/2022 - Mon
Chinmay Patel

Hi Tom,

I have been adding large reference files to Visual Studio for a while now. I do not think you have to open the file to see methods and other things.

1. If you can, refer to the documentation
2. You can use Object Browser
3. Just start typing in and let intellisense take care of the rest. This is bit cumbersome but have always worked for me.

PS: What is the configuration / specs of your Dev machine?

Regards,
Chinmay.
kaufmed

but I can't just delete the file, right?
If you want to use the code to interact with the service, no.

I want to compress it or compile it or do something so it reduces the impact on my system.
Can't really do that either. It's an auto-generated code file, and any changes you make to that file will be blown away the next time you hit the "Configure Service Reference" menu option. I question why you would ever need to look at the file, as Chinmay has mentioned. Don't get me wrong:  There are occasionally times when you need to review this file to see what it generated, but those times are rare. You shouldn't need to open--as a matter of course--this file.

You could create a library that maintains the service reference, and import that library into your project, but all that really does is add another layer to your application--which can be good for abstraction/decoupling, but it does increase the complexity of your application.
Tom Knowlton

ASKER
sys specs
Your help has saved me hundreds of hours of internet surfing.
fblack61
Tom Knowlton

ASKER
You could create a library that maintains the service reference,

But no real performance gain by doing this?

No - you're right - I don't NEED to open the file.  I am just "concerned" that it crashes Visual Studio when I do.  

So if I wanted Visual Studio (or any other app) to be able to open large files like this, I need more than 32 GB of RAM?
Tom Knowlton

ASKER
.... so what is Visual Studio doing when it looks at the file behind the scenes?  It is not crashing even though it depends upon this file.  It's only when I open the file myself in a tab inside VS that it crashes.
Arana (G.P.)

if all else fails you will have to open it using notepad or other editor, not really a solution but at least you could read it that way.

what is vs doing? checking that all files, and registry settings are in place (I suppose), so checking a large registry against a large file, in botch 32 and 64 hives, and large filesystems, this is only assumptions as what it does when it GENERATES the file, but I suppose it also means it checks many of those things when opening so it can show you any errors
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
kaufmed

But no real performance gain by doing this?
No.
ASKER CERTIFIED SOLUTION
Chinmay Patel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Tom Knowlton

ASKER
Thank you, everyone.  My solution for now is to leave the file alone.  As long as I do, it seems to be content and VS does not crash.  I imagine if I had more RAM the "problem" would go away.