Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squishit.less adds C# file to VB project #232

Open
dannylloyd opened this issue Mar 6, 2013 · 9 comments
Open

Squishit.less adds C# file to VB project #232

dannylloyd opened this issue Mar 6, 2013 · 9 comments
Labels

Comments

@dannylloyd
Copy link

When adding SquishIt.Less from nuget, SquishItLess.cs is added to App_Start instead of SquishItLess.vb. If you don't support VB, then you can close this issue.

@AlexCuse
Copy link
Collaborator

AlexCuse commented Mar 7, 2013

We definitely don't mean to exclude VB. I'm not terribly familiar with the way the WebActivator stuff gets added by NuGet but I can try to figure it out. I'd like to have it install an equivalent SquishItLess.vb if possible.

@AlexCuse
Copy link
Collaborator

AlexCuse commented Mar 7, 2013

This commit looks like what we'd need (basically include the initialization method in our assembly and specify the pre application start method in assembly info)

alexbeletsky/elmah-mvc@abf84ae

Shouldn't be terribly difficult - I'll aim to include this in the next release.

@AlexCuse
Copy link
Collaborator

AlexCuse commented Mar 7, 2013

Ugh, looks like the PreApplicationStartMethod attribute was added in ASP.net 4. I will make the changes in a branch, but will need to collect more feedback before making a change like that (a 1.0 release might be a reasonable time to do this).

AlexCuse added a commit to AlexCuse/SquishIt that referenced this issue Mar 7, 2013
AlexCuse added a commit to AlexCuse/SquishIt that referenced this issue Mar 7, 2013
@AlexCuse
Copy link
Collaborator

AlexCuse commented Mar 7, 2013

Ok this seems to be working, as of the commit above. I didn't actually test in a VB project, but this brings the initialization code into the library so it should work for either. Tested by commenting out the LESS preprocessor registration in our test project and running the LESS test page.

This has approach has the addiitional benefit that it will automagically register for everyone, not just folks who install via nuget (of course this assumes I get around to fixing #221 so people can actually install that way ;) )

@dannylloyd
Copy link
Author

Thanks for the quick response. I was converting a project from C# to VB and added the packages and ran into this problem. For a workaround, I added a SquishItLess.vb file to replace the C# file. This project taught me that C# is much easier to work with.

AlexCuse added a commit to AlexCuse/SquishIt that referenced this issue Mar 7, 2013
AlexCuse added a commit to AlexCuse/SquishIt that referenced this issue Mar 7, 2013
AlexCuse added a commit to AlexCuse/SquishIt that referenced this issue Mar 7, 2013
@AlexCuse
Copy link
Collaborator

AlexCuse commented Mar 7, 2013

Well hopefully we can at least eliminate any part of VB being hard to work with that we directly caused! We probably won't be cutting another release for a while but it might be fair to start requiring .net 4 for the preprocessors at this point (some of them already required it).

If you don't like having the random .vb file sitting around , you can copy the Bundle.RegisterStylePreprocessor(...) line from that into the Application_Start method of your Global.asax.cs. Or Global.asax.vb I guess in your case :D

@AlexCuse
Copy link
Collaborator

AlexCuse commented Mar 7, 2013

I created a poll to try and figure out what ASP.net version people are using - if anyone comes across this issue thats interested please respond :)

http://poll.fm/44txp

@AlexCuse
Copy link
Collaborator

When we do this it may be worth using WebActivator's PreApplicationStartMethod attribute instead of ASP.net's (see http://blog.davidebbo.com/2011/02/new-features-in-webactivator-13.html)

Using WebActivator will allow us to call code that we define in the bootstrap classes for preprocessor registration, and also provides a similar ApplicationShutdownMethod attribute that could be used to automate calls to a method that cleans up temporary files created when resolving embedded resources (see issue mentioned above for details).

@AlexCuse AlexCuse mentioned this issue Jun 3, 2015
11 tasks
@AlexCuse
Copy link
Collaborator

related AlexCuse@acc105e

AlexCuse added a commit to AlexCuse/SquishIt that referenced this issue Dec 23, 2015
AlexCuse added a commit to AlexCuse/SquishIt that referenced this issue Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants