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
116 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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 …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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