Should I remove the files marked with yellow? - wcf

I have a WCF service in my console project. If I expand the service reference in the project node, you will find some files marked with yellow ! triangle sign.
For example: BOERPI.disco, BOERPI1.xsd and BOERPI2.xsd in the image file. If I double click it, it gave me the warning such as:
Why it happened? Should I remove them?
Also please look t the image, there are files of configuration.svcinfo and configuration91.svcinfo. They don't have yellow mark. Should I delete one of them?

Those files are automatically generated by the Visual Studio Add Service Reference wizard. You shouldn't manually edit/delete those files. The only file that really matters is the Reference.cs (or .vb as appropriate) contained under the Reference.svcmap node. That file contains the actual C# (or VB) service proxy implementation classes.
You can regenerate the BOERPIServiceReference node by right clicking on that item in Solution Explorer and selecting the Update Service Reference option. If Visual Studio won't let you do that, then get the URL (or file path) to the service WSDL, delete the current service reference and go through the Add Service Reference wizard again using the identical service reference name as the current reference.

Related

How to set the startup project for an asp.net core template?

I am currently creating a multi-project template, I want to distribute using a .VSIX-extension for Visual Studio. When the extension is installed the user can select my template among the others provided by Microsoft in the "Create a new project" window.
My template consists of three project:
ProjectName.Server
ProjectName.Contract
ProjectName.Client
ProjectName is the user-given name while the suffixes "Server", "Contract" and "Client" are fixed. The issue I experience is that when the users create a new project the Client-project is always selected as a startup-project by default. I want the server-project to be selected as a startup-project by visual studio. It looks like following:
The client project is not the correct startup project, but users don't know that the server project it the correct startup project, so I want to take off the selection and integrate it right into the template, so the correct startup template is selected by VS when creating the project.
I already removed the suffix "Server" from this project, so it is shown as the first project in the solution explorer and I hoped VS would then select it as the startup-project. This did not work unfortunately.
Can anyone give me a hint on how to configure the startup-project in the template?
If you have any questions don't hesitate to comment.
These configurations are stored in the Solution User Options (.suo) file.
You can refer to my steps below to try:
First, Close Visual Studio and find the folder where your solution is.
Second, Open the .sln file with a text editor, you see all your projects encapsulated in Project – EndProject lines:
Third, Cut and paste the desired default startup items into the first.
Fourth, Delete your .suo file(hidden files: Solution Folder/.vs/Solution Name Folder/v17/.suo, I use VS2022).
Finally, Open your solution in Visual Studio.
You can have a try.
You will likely need to associate a custom IWizard assembly with your project template, and then explicitly set the startup project by setting the SolutionBuild.StartupProjects to the desired project in your solution.
Once upon a time, I did this using code similar to the following:
VSProject startupProj = FindVSProject(startupProjName);
sln.SolutionBuild.StartupProjects = startupProj.Project.UniqueName;
where FindVSProject was implemented as:
private VSProject FindVSProject(string projName)
{
foreach (Project p in _dte.Solution.Projects)
if (p.Name.Equals(projName, StringComparison.CurrentCultureIgnoreCase))
return p.Object as VSProject;
return null;
}

Namespace path broken after changing Resources.resx properties

I have a runtime System.Resources.MissingManifestResourceException on my VB.Net VSTO. I read this was likely due to wrong settings in my resources file. So I went into the properties and made sure Build Action was set to Embedded Resource(and it was).
Just below, I saw Copy to Output Directorywas set to Do not copy. I thought it would not hurt if I just changed it to Copy always and gave it a try to compile.
It did not fix anything, but now Build Action has changed to Content, and I have dozens of BC30456 errors:
'Resource' is not a member of 'WordAddIn.My'
When I go to the error, I end up in a UserControl designer, and the line with an error shows: Me.Button_Foo.Image = Global.WordAddIn.My.Resources.Resources.Resource_Bar
I did set my resources file settings back to what they were (Embedded Resource, and Do not copy), but the errors remain..
Note: the namespace of Resources.Designer is My.Resources, and the Resources class and its members are Friend. However intellisense does not let me access the namespace from any of the objects where I have the build errors. I have tried changing the "Custom Tool Namespace" for other names but It does not appear from anywhere in the project. (the custom tool does update the Resources.Designer.vb file, and I would say it does it properly)
UPDATE
Resources.Designer.vb is not included in the project, but shows in the "Miscellanous Files". Same symptom as this post: Visual Studio - project shows up as "Miscellaneous Files"
I did (1) exclude the Resources.resx (cannot work on Resources.Designer.vb alone) from the project, (2) clean the solution, (3) restart Visual Studio, (4) clean the solution (zust'in'kase), (5) an then re-included it, the problem now is that Resources.Designer.vbis included in the project, but does not sit as "embeded" within the Resources.resx, so I am afraid I might have broken it?
The fix with Visual Studio 2017 was the following:
Note the Custom Tool namespace: in solution explorer, right click the Resources.resx file -> 'Properties' and memorize the value for the 'Custom Tool Namespace' field. (needed for step 6)
Remove the Resources.resx and the Resources.Designer.vb files from project: in solution explorer, for each file, right click -> "Exclude from project"
Clean / Rebuild solution
Restart Visual Studio
Re-include the Resources.resx file , but not the Resources.Designer.vb: in solution explorer, make sure you have the [Show All Files] button enabled (near [Refresh]); the resources file should appear with a greyed folder/file symbol next to it; right click -> "Include in project" (or alternatively, right click on the 'My Project' node and choose 'Add' / 'Existing item..'
In solution explorer, right click on Resources.resx -> 'Properties': make sure 'Custom Tool' value is "PublicVbMyResourcesResXFileCodeGenerator"; and that 'Custom Tool Namespace' corresponds to the value it had before you removed the file from project (see step 1.).
In solution explorer, right click on Resources.resx -> 'Run Custom Tool'
A new designer file should be generated automatically.

Generate manifest for regfree COM from a VB project

I am trying to generate a manifest for a set of COM objects that are being used in our code as registration-free COM.
For that purpose I created a VB project in VS 2010 and added the COM objects DLLs as dependencies. The problem is I do not see them listed as dependencies in the generated manifest. Am I missing something simple like a project setting to generate the proper manifest listing the dependencies?
You left out too many details and the VB.NET IDE hides too much to do this right. It is not automatic.
Starting point is to force it to show more. Locate the "Show All Files" toolbar button in the Solution Explorer window (use the tooltip to find it back). Click it and you now get the "References" node added to the project.
Open it and locate the COM component that you added to the project. Select it and look at the Properties window. Set the "Isolated" property to True. Rebuild the project. Be sure to look in the Output window for any warnings. And to look at the .manifest file on disk instead of the one the IDE shows you if you added a manifest to your project yourself.

What is ApplicationEvents.vb file from

Just noticed a file named ApplicationEvents.vb in my vb.net project in the solution explorer, its empty...
Where would this have come from? is it safe to delete?
It is a file that can house common Application events like Startup and Shutdown. This is a partial class, so it would get compiled in when building the solution.
If it is empty, then it is safe to delete, but if you ever want to handle these events, then this is where you can easily hook into these events.
Read How to: Handle Application Events (Visual Basic) for more information.
Im using visual studio 10
The applicationevents.vb is not safe to delete if its empty. The project will fail to build properly because the file is missing. The project has some kind of internal reference to the file if you have created it. By default this file is not included unless you have clicked the "Application Events" button on the application tab in the project properties....
what I really want to know is why is mine blank....

Adding DLL reference to VB.NET project

Just to start off, this question does seem very similar to another post Add the DLL (lame_enc.dll) reference to my project, but I haven't been able to successfully apply that answer. I am pretty new to VB.NET so it is very possible I'm simply missing something obvious.
I am trying to link a DLL to a VB.NET 2010 project to allow my VB app to play *.ogg files. I followed some other advice here on the forums and downloaded FMOD's FMOD Ex Programmers API. I am trying to now reference that functionality. These appear to be the files I need to somehow reference.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex64.dll.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\libfmodex64_vc.lib.
I haven't discovered how to add a *.lib reference (or the equivalent), but selecting the DLL as a reference gives the following error.
A reference to 'C:\Program Files (x86)\FMOD SoundSystem\FMOD
Programmers API Windows\api\fmodex64.dll' could not be added. Please
make sure that the file is accessible, and that it is a valid assembly
or COM component.
I'm not sure what I could be missing. Any ideas? Thanks!
In Solution Explorer, double-click the My Project node for the project.
In the Project Designer, click the References tab.
Click the Add button to open the Add Reference dialog box.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, then click OK.
Another approach I was trying is working for me. I found a site with a working example of a LibZPlay VB.NET sample ( http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7789&lngWId=10 ). It runs under VS 2008 and I was able to adapt my project to use LibZPlay (open source library http://libzplay.sourceforge.net/WELCOME.html ) under VS 2008.
That is sufficient for me for now. Thanks for your advice. It was likely some configuration issue or misunderstanding on my end.
Using VB.net 2015 I (could not add or even find a System32 dll) as a reference using Solution Explorer, Tab References. Going to the MAIN Menu, Projects/Add References...
Used Browse and All the System32 dll were visible. Then I was able to load the needed dll.