question

RodAtWork avatar image
0 Votes"
RodAtWork asked YijingSun-MSFT edited

What assemblies does RouteConfig and BundleConfig need?

'm improving on an old ASP.NET WebForms app that was assigned to me when I joined DOH back in 2015. I had to pull this thing together from bits and pieces scattered around the network, since the original developer didn't put it into any source control, didn't leave it as a Visual Studio solution, etc. Anyway, I've finally got it into TFS properly, so that it can now be tracked. Only thing now is several odd errors I'm getting when trying to build it. At the moment I'm looking at the Global.asax.vb file (the original developer coded it using VB.NET). Here's the contents of that file:

 Imports System.Web.Optimization
    
 Public Class Global_asax
     Inherits HttpApplication
    
     Sub Application_Start(sender As Object, e As EventArgs)
         ' Fires when the application is started
         RouteConfig.RegisterRoutes(RouteTable.Routes)
         BundleConfig.RegisterBundles(BundleTable.Bundles)
     End Sub
 End Class

Visual Studio is complaining about RouteConfig and BundleConfig, saying they're not defined. I believe the issue is it's not including the necessary .NET assemblies. Its including System.Web.Optimization, but I'm wondering what else it needs?

The guy who wrote this thing (I never met him) I think wrote it using .NET 2. Maybe older. I've upgraded it to .NET 4.5.2

dotnet-aspnet-webforms
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RouteConfig and BundleConfig are part of a coding pattern in Visual Studio's Web Forms project template. RouteConfig is a module and BundleConfig is a class. The source files are located in the App_Start folder. I recommend creating a new Web Forms project and reviewing the pattern.

RouteConfig configures how HTTP requests are mapped to aspx pages. BundleConfig groups and minimizes js and css files to reduce page load times. It's doubtful the original developer left RouteConfig and BundleConfig files unchanged. You'll need the source code or try to piece this together by looking at the hosted files. You've been working on this project for 6 years so I image you have a vey good idea how the application works.


0 Votes 0 ·
SimpleSamples avatar image
0 Votes"
SimpleSamples answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YijingSun-MSFT avatar image
0 Votes"
YijingSun-MSFT answered YijingSun-MSFT edited

Hi @RodAtWork ,
As far as I think,your problem is that you need to create the RouteConfig.cs and BundleConfig .cs file. These are the visual studio designed by default. You could create a new project to compare your project.

Best regards,
Yijing Sun


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.