Solved

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

Posted on 2016-08-30
4
109 Views
Last Modified: 2016-09-22
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
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 30

Expert Comment

by:Randy Downs
ID: 41810630
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
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 41810974
So there is no way to manage the AssemblyInfo.cs file via the GUI / IDE?
0
 
LVL 30

Accepted Solution

by:
Randy Downs earned 500 total points
ID: 41811013
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
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 41811178
Thank you!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

731 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question