Are there any additional installation requirements to use Poor Man's T-SQL Formatter in SQL Server Management Studio? Because I am unable to access it - tooltip

I have installed poor man's SQL formatter in SSMS v18.9.1

See issue #265 in the Github repository and link to a fix in issue #244.
Edit ssms.exe.config
C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE
In <assemblyBinding> Add
<dependentAssembly> <assemblyIdentity name="Microsoft.VisualStudio.Shell.12.0" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <bindingRedirect oldVersion="2.0.0.0-15.0.0.0" newVersion="15.0.0.0"/> </dependentAssembly>

Related

Visual studio MVC razor view intelisens and breakpoints not working

I am using visual studio 2012 (Premium). I have a project that is using MVC. I am not able to add any breakpoint to the view(s) and thus unable to debug the variables at view side.
Moreover, Intelisens is also not working at views.
What I have tried:
I tried resetting the user setting devenv.exe/resetusersetting.
Tried clear the cache using below command:
Hide Copy Code
C:\Users\pgoel\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
I also tried many other things I came cross while looking for the solution but nothing works. Please help me out to get it fixed.
After spending a lot of time looking for solution, I come across that for MVC projects, the version of MVC I am using should be installed in the environment. Although if I have added the dll but not installed in environment, the project will work but intellisense won't work.
Here is the fix. Go to web.config.
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
</dependentAssembly>
See the version of MVC you are using and run the following Nuget command to install it.
PM > Install-Package Microsoft.AspNet.Mvc -Version 5.2.3
Version should be the same as mentioned in you web.config or MVC dll you are using.
See link for more information

IISExpress VS.Net 2015 - HTTP Error 500.22 - An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

I've an ASP.NET MVC5 web app on my local Win 10 machine. Recently, I upgraded some Nuget packages and MVC4 to MVC5. And updated the target framework version to .Net v4.5.
Now, when I debug the web app from local VS.Net 2015 Community version I get the following error -
HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been
detected that does not apply in Integrated managed pipeline mode.
Most threads I found were for IIS I'm talking about IISExpress. They suggested to change the web app's App Pool to a Classic in IIS (Post1, Post2, Post3). But VS.Net uses IISExpress so I went deeper into that as well and located - C:\Users\\Documents\IISExpress\config\applicationhost.config. Tried to edit it but it would allow me to configure only one WebSite1 which is localhost:8080 and mine runs as localhost:1960.
I've also tried the appcmd commandline approach but unless I've a website 'localhost:1960' there seems no way. I also sought an IISExpress UI tool Jexus but my 'localhost:1960' website is not listed.
Apparently, setting
<validation validateIntegratedModeConfiguration="false" /> in
web.config
fixes it. But its not the best solution. And I can't remove httpHandlers or modules from my web.config.
I need to know how to manipulate the IISExpress that is invoked by VS.Net 2015 while debugging. Not IIS.
Thank you.
Finally, I'm able to crack it for VS.Net 2015 and its configuration of IISExpress. ITs not possible to configure it 'externally' and nothing will work if you keep modifying IIS or IISExpress settings outside VS.Net.
It took me a while to narrow down my focus to VS.Net proj properties and configurations. I found that VS.Net created its own version of "applicationhost.config" which can be found at -
<myProject.sln path> \.vs\config\applicationhost.config
This is the file in which I had to change the application pool (applicationPool="Clr4ClassicAppPool) -
<sites>
<site name="WebSite1" ... ignore this sction if present
</site>
<site name="myProject" id="2">
<application path="/" applicationPool="Clr4ClassicAppPool">
<virtualDirectory path="/" physicalPath="D:\Source\myProject" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:1960:localhost" />
</bindings>
</site>
You just need to change the applicationPool (your Classic App pool name might be diff in that case get the correct one from in the same file). Also make sure you're updating the correct "site" node (the correct localhost url of your web app when debugged from VS.Net)
If still there's an issue set the following -
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
If still there's an issue, make the above mentioned changes in this file as well -
C:\Users\<youruser>\Documents\IISExpress\config\applicationhost.config
Might need restart as well. Hope this helps.
I'll make a clean and simple answer for IIS express. And its working on 2018.
1) Go to your main solution directory which .sln file stands.
2) Navigate and open:
\.vs\config\applicationhost.config
3) Find your project name
<site name="Your.Project.ServiceName" id="2">
4) Change application pool from Clr4IntegratedAppPool -> Clr4ClassicAppPool
<application path="/" applicationPool="Clr4ClassicAppPool">
5) Restart your visual studio.
6) Enjoy!

Sysparam error with piranha CMS

I've added a piranha CMS template to a MVC empty application from nuget, but when run the first time I get a "Invalid object name sysparam" exception.
I've create a database named piranha-db without tables.
I'm using MVC5.
I've changed my web config following the getting started rules.
There's a miss with the 2.2.4 core package. Upgrade to the latest 2.2.4.1 patch available on NuGet which resolves the Automapper issue. Maybe your other issues are related!
Installing PiranhaCMS for MVC 4
Open Visual Studio 2012
Menu. File -> New -> Project
ASP.NET MVC 4 Web app.. (Installed -> Templates -> Visual C#)
Press Ok
Select Empty
Press Ok
Open Package Manager Console (PM) (Tools -> NuGet Package Manager -> Package Manager Console)
Copy to PM "Install-Package PiranhaCMSMvc". Press Enter
If any promt. Write A to say yes to all overwrites of files etc.
Change Web.config. Add to
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>"
Run (should see a info-text about db-setup)
Create a db called "piranha-db"
Change web.config < connectionStrings ... > (according to info-text about db-setup). Ex.
<add name="piranha" connectionString="data source=.\SQL2012;initial catalog=piranha-db;integrated security=true;multipleactiveresultsets=true;" providerName="System.Data.SqlClient" />"
Go back to browser and click continue-link at bottom of the page
Done! (follow instructions to admin etc...)

JavaScript critical error SCRIPT1002: Syntax error

In IE11, my MVC project will not build. I get the Script1002 errors on every javascript library I have linked. It works under IE9. It also works with Chrome and Firefox. I can open IE11 and then paste in the localhost site and it works, but it doesn't work from the VS2012 IDE.
Has anyone had an issue like this with IE11?
I get the error as a dialog box from Visual Studio, before the site appears in IE11.
I got the same error with Visual Studio 2012.
I got this error:
SCRIPT1002: Syntax error
I solved the problem by giving the anonymous access to the script folder in the WEB.CONFIG
<location path="XXXXXX">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
Replace the "XXXXXX" with your Javascript folder.
The error was because the browser need to access Javascript in the script folder.
Hopefully this will resolve anyone who got the same error in Visual Studio if you got the error.

CS0234: Mvc does not exist in the System.Web namespace

I converted a ASP.net 4 webform project to Asp.net MVC4 according to Chapter 13 of the Professional ASP.NET 3.5 MVC, by Scott Hanselmen, Phil Haack, and Rob Conery, Published by Wiley Publishing, Inc. (ISBN: 978-0-470-38461-9). I also followed this blog. Now I can add Controllers, Views, etc. All the references are set properly. No build errors. But upon launching the converted project, I got compilation errors. I have mvc3 installed on the same machine. I even changed the reference to that. It still complain. Could you help? Thanks.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Source Error:
Line 109: <namespaces>
Line 110: <add namespace="System.Web.Helpers"/>
Line 111: <add namespace="System.Web.Mvc"/>
Line 112: <add namespace="System.Web.Mvc.Ajax"/>
Line 113: <add namespace="System.Web.Mvc.Html"/>
Source File: c:\Users\Jon\Documents\Visual Studio 2012\Projects\CMT\Apps\Branches\3.0\Web.config Line: 111
I had the same problem and I had solved it with:
1.Right click to solution and click 'Clean Solution'
2.Click 'References' folder in solution explorer and select the problem reference (in your case it seems System.Web.Mvc) and then right click and click 'Properties'.
3.In the properties window, make sure that the 'Copy Local' property is set to 'True'
This worked for me. Hope it works for someone else
Helpful Note: As it has mentioned in comments by #Vlad:
If it is already set to True:
Set it False
Set it True again
Rebuild
This problem can happen when you deploy your web application to a server, so you must check if you already installed MVC3.
Check if the folder C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3 exists.
If it doesn't exist, you need to install it from http://www.microsoft.com/en-us/download/details.aspx?id=1491
If you wont to install you can add all DLLs locally in bin folder and add references to them this work fine if you host on server don't deploy ASP.NET Web Pages or MVC3.
Check your runtime tag inside the web.config, and verify you have something like this declared:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
.....
</runtime>
add Microsoft.AspNet.Mvc nuget package.
I tried all these answers, even closed Visual Studio and deleted all bin directories.
After starting it up again the MVC reference appeared to have a yellow exclamation mark on it, so I removed it and added it again.
Now it works, without copy local.
None of previous answers worked for me.
I noticed that my project was referencing another project using the System.Web.Mvc reference from the .NET Framework.
I just deleted that assembly and added the "Microsoft.AspNet.Mvc" NuGet package and that fixed my problem.
You need to include the reference to the assembly System.Web.Mvc in you project.
you may not have the System.Web.Mvc in your C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0
So you need to add it and then to include it as reference to your projrect
I had this problem, but all the applications in IIS were broken when they had been working previously. None of the marked solutions helped me. The problem ended up being an extra copy of web.config had been introduced to my root directory. I removed that file and problem solved.

Resources