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
64 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:knowlton
  • 2
  • 2
4 Comments
 
LVL 29

Expert Comment

by:Randy Downs
Comment Utility
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:knowlton
Comment Utility
So there is no way to manage the AssemblyInfo.cs file via the GUI / IDE?
0
 
LVL 29

Accepted Solution

by:
Randy Downs earned 500 total points
Comment Utility
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:knowlton
Comment Utility
Thank you!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now