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
73 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
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:knowlton
ID: 41810974
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
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:knowlton
ID: 41811178
Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tool Box 2 32
ASP.NET 5 Templates 2 65
Javascript and Jquery not firing 9 37
What do you call this line of code in this .NET Core page? 4 16
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

943 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

10 Experts available now in Live!

Get 1:1 Help Now