• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

AssemblyInfo.cs C# ASP.NET - way to add WebResource entries via the mouse / GUI / IDE (not type them manually)?

I've been manually typing in entries into my AssemblyInfo.cs file (in the Properties folder) for my custom server control.  Each of the entries is an embedded resource.

[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.datePickerSC.js", "text/javascript")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.date.js", "text/javascript")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.moment.js", "text/javascript")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.moment-datepicker.js", "text/javascript")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.css.datepicker.css", "text/css")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.css.datepicker2.css", "text/css")]

Open in new window


I am wondering a few things:

1)  Can I have the GUI / IDE add these for me via mouseclick or drap and drop?  Typing them in by hand seems error-prone.  Must I type them in manually?

2)  Instead of referring to each file via folder structure, can I refer to the containing folder only ... and have it include all files INSIDE that folder automatically?

So instead of this:

[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.datePickerSC.js", "text/javascript")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.date.js", "text/javascript")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.moment.js", "text/javascript")]
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript.moment-datepicker.js", "text/javascript")]

I would do something like this:

//include ALL .js files inside the javascript folder
[assembly: WebResource("DealerSocket.Web.WebForms.Controls.CSharp.javascript", "text/javascript")]
0
Tom Knowlton
Asked:
Tom Knowlton
  • 2
  • 2
1 Solution
 
Randy DownsOWNERCommented:
Maybe this will help.

Since changing each AssemblyInfo.cs file can be time consuming and error prone, most projects take one of two approaches to solving the problem:

1. Generate AssemblyInfo.cs files using an nant build scripts and setting properties.
2. Use a single AssemblyInfo file and have all projects reference that file.

Both approaches have pluses and minuses. Generating AssemblyInfo.cs can be hard to setup and get correct but is more flexible. Using a single AssemblyInfo.cs and have each project reference it is easier but all projects will have the same information in the assembly properties.

A hybrid approach that many developers overlook is splitting AssemblyInfo.cs into an assembly specific version and a product wide version. Each Visual Studio project would contain the standard AssemblyInfo.cs file that is generated by the project templates. The difference would be that product wide attributes are removed
0
 
Tom KnowltonWeb developerAuthor Commented:
So there is no way to manage the AssemblyInfo.cs file via the GUI / IDE?
0
 
Randy DownsOWNERCommented:
Try this .

Setting attributes of the AssemblyInfo class can be accomplished two ways:

through the Assembly Information dialog box of your project's Properties.
through the AssemblyInfo.cs file located within your Solution Explorer.
Assembly Information dialog box
To access the Assembly Information dialog box, double click the Properties file within your project's solution on the Solution Explorer. This will raise the Properties Editor. Select the Application tab and then click the Assembly Information button to open the Assembly Information dialog box.

Modify the fields within the dialog box and click OK to save your settings. All changes will be saved within the AssemblyInfo.cs file. For more information on the Assembly Information Dialog Box, see Assembly Information Dialog Box This link is external to TechNet Wiki. It will open in a new window. .
0
 
Tom KnowltonWeb developerAuthor Commented:
Thank you!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now