SSRS 2008, custom dll, file not found - ssrs-2008

I've been fighting with SSRS now for a while and it's beyond silly. When I add a reference to a dll (which is part of the same solution) it gives me nothing but a
[rsErrorLoadingCodeModule] Error
while loading code module:
‘MyFile.MyClass.Code, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null’.
Details: Could not load file or
assembly 'MyFile.MyClass.Code,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its
dependencies. The system cannot find
the file specified.
I've tried hitting the solution config to tell it debug source is in other locations, copying the file to about 50 different locations (not gac, not possible), running Visual Studio 2008 as admin, all the goofy stuff you can think of ... nothing, same error everytime.
Any ideas?

Here is the actual correct answer.. I've had to fight with this twice now and did not document it well enough the first time thinking it was a one-time thing.
Putting it in the SQL Server Bin folder is for the server. for DEVELOPMENT put a copy in the Visual Studio folder,
something like:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies
or Windows 7 64 bit
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies

I got a similar error on ssrs-2005.
Just manually copy your dll to the following report server folder: "C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin" and everything should work fine.

You may need to add references to the assemblies that your MyFile assembly itself references. So, if MyFile references System.IO for example, you may need to add that dll reference explicitly to the report.

For those who have been having trouble with custom dlls which import System.Data.SqlClient, I found the following tip absolutely essential in the rssrvpolicy.config file:
Short and dirty answer: Change the PermissionSetName attribute from
"Execution" to "FullTrust" for CodeGroup
"Report_Expressions_Default_Permissions".
I hope this helps someone.

Related

Publish (FTP) fails from MSBUILD

If I publish with my website with Visual Studio (using FileSystem) it works fine.
Now I'm attempting to do the same from Powershell.
.\MSBuild.exe $sln /p:PublishProfile=MyTestProfile /p:PublishProvider=FileSystem /p:CreatePackageOnPublish=False /p:DeployOnBuild=False /p:VisualStudioVersion=15.0 /v:diag
The above is based upon the output window (of Visual Studio) when I publish (using diagnostic output). Things are copied and pasted to avoid typos.
The problem I have is it never publishes!
I am now shown the following message from Powershell:
Build FAILED.
"C:\Users\me\source\repos\Test03\WebApplication2\WebApplication2.csproj" (default target) (1) ->
C:\Users\me\source\repos\Test03\WebApplication2\WebApplication2.csproj(265,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
This issue appears to be well documented here on SO but, I already have VS installed, and this isn't a build server. It's all being done on my one machine... However, if I try to get to the path C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets it doesn't exist. I have C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\ but within this folder only 1 folder called FileTracker.
This now confuses me more because it works from within Visual Studio, but not within Powershell.
Resolved with
.\MSBuild.exe $sln /p:PublishProfile=MyTestProfile /p:PublishProvider=FileSystem /p:CreatePackageOnPublish=False /p:DeployOnBuild=True /p:AspnetMergePath="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools" /p:VisualStudioVersion=15.0 #/v:diag
You may not have the path for the correct visual studio version. Downloading .NET Core SDK should provide this https://www.microsoft.com/net/download/windows
However, you may need to update to the correct path for the build path (where msbuild.exe exists).
I then had to add /p:AspnetMergePath="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools" manually for reasons I don't understand. I understand that it coudln't find this path, but I didn't understand why it can't find the path when VS could!

Opshub conversion troubles to Visual Studio online and converting DOS (8.3) short paths

I am trying to convert our repository from TFS 2012 on-premise to Visual Studio Online.
I am getting errors like this:
OH-SCM-009: Error occurred while sync. TF203013: The path O:\somepath\Jeffkn~1.jpg is in the DOS (8.3) short path format and is not supported. Enter a full path to the item and try again.
I believe we did this during our migration back in the day (method 2):
https://support.microsoft.com/en-us/kb/951195
Which is to add <add key="allow8Dot3Paths" value="true" /> to our TFS temporarily during a migration.
How do I accomplish this today with Visual Studio Online / OpsHub?
Thanks!
The path contains a file name that is in the MS-DOS-compatible short name format (in your case is Jeffkn~1.jpg), you need to change the path to rename the Jeffkn~1.jpg file, for example Jeffkn.jpg.
Additionally, you can't take Method2 in the KB article to enable TFS2012 Application Tier server to allow the MS-DOS-compatible short name format, because there is no problem to have this path in on-premise TFS, you have the problem when migrate item to VSO. So, you need to enable the MS-DOS-compatible short name format for VSO, but I don't think you have permissions to do it.
Could you Please try below steps, it might help
First close the migration utility then add the app setting key "allow8Dot3Paths" to devenv.exe.config ("c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE) or in "c:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE
Under the <configuration> element, locate the <appSettings> element, and then add the following element.
<add key="allow8Dot3Paths" value="true" />
in the devenv.exe.config file.
Now start the migration utility, start the migration and retry the failure, wait for the retry to complete and if you still get the error then please email us the OpsHubTFSService.log file from location "C:\Program Files\OpsHub Visual Studio Online Migration Utility\logs" to support#opshub.com

Where does the Xml Serializer store its dynamically generated code?

The XML serializer in System.Xml.Serialization namespace generates the XmlSerializationReader and XmlSerializationWriter classes dynamically using CodeDOM.
I want to have a look at these classes in the disassembler.
Where does the serializer store the temporary assembly file that has this dynamically generated code? I have been trying to find it out for the last 30 minutes in Reflector but to no avail.
All I gather from Reflector is that it stores it in some temp directory. I looked up C:\temp but there's no .dll there. I looked up C:\tmp and there are some PNG files there that seem like they are not really PNG's but some binary files generated by Windows for storing temporary data.
If you know, please tell me.
Alright, these two threads out of the dozen or so pertaining to this issue that I looked up reveal the answer.
This thread says it is the folder C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp
http://snavin.wordpress.com/2013/04/01/xmlserializer-is-running-does-not-have-sufficient-permission-to-access-the-temp-directory/
But from the stack trace posted in the original question on this thread, it appears that the temp folder of the windows environment, which can be found out by calling System.IO.Path.GetTempPath() is where the dll is saved.
ASP.NET Access to the temp directory is denied
There is an easy way: use sgen.exe to generate necessary assembly by yourself.
On my machine it looks like:
C:>"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\sgen.exe" "C:\Projects\BIN\My.dll"
Microsoft (R) Xml Serialization support utility
[Microsoft (R) .NET Framework, Version 4.6.1055.0]
Copyright (C) Microsoft Corporation. All rights reserved.
Serialization Assembly Name: My.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
Generated serialization assembly for assembly c:\projects\bin\My.dll --> 'c:\projects\bin\My.XmlSerializers.dll'.

Metadata file not found - Data.Entity.Model

Anyone having similar problem, while creating webservices?
Compiling transformation: Metadata file 'D:\Program
Files\VS2013\Common7\Tools..\IDE\Microsoft.Data.Entity.Design.dll'
could not be found D:\PROJEKTY\apki\ws2\WS\WS\DataModel.tt
I tried adding data model again, restarting VS, cleaning and building solution, creating new project, deleting and adding reference, installing the newest version. I think that any solution found on internet does not work for me.
Any suggestions? I think of pasting file into this directory, but can't think what may be there.
Based on
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude
, the code generator is looking for the missing DLLs in the following locations:
<## assembly name="%VS120COMNTOOLS%..\IDE\EntityFramework.dll" #>
<## assembly name="%VS120COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll" #>
I discovered that the environment variable %VS120COMNTOOLS% is not compatible with the correct installation path of visual studio, so I changed it from Advanced system properties and it worked
Check your install location. I installed VS to the other location D:\ than default C:\ so I got the error.
modify "Environment Variables" to your location, for me it means changing C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\ to D:\Microsoft Visual Studio 12.0\Common7\Tools\.
DON'T Forget to add a \ to the end of word.
I believe VS is not updating the VS120COMNTOOLS variable correctly when reinstalling VS to a different drive. See this SO thread for an extended answer.
The problem lies in the fact that the file originally EF6.Utility.CS.ttinclude wrong. Even if the variable %VS120COMNTOOLS% is the correct value, the error still occurs.
Blame the two stupid points in the following lines (%VS120COMNTOOLS%..\IDE):
<## assembly name="%VS120COMNTOOLS%..\IDE\EntityFramework.dll" #>
<## assembly name="%VS120COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll" #>
If that's the way to fix the error no longer occurs:
<## assembly name="%VS120COMNTOOLS%\IDE\EntityFramework.dll" #>
<## assembly name="%VS120COMNTOOLS%\IDE\Microsoft.Data.Entity.Design.dll" #>
And the variable %VS120COMNTOOLS% must have the correct value, of course.
The question is old, but the answer is still relevant now, because this error persists, and in the VS2015. Below lines from the ill-fated file:
<## assembly name="%VS140COMNTOOLS%..\IDE\EntityFramework.dll" #>
<## assembly name="%VS140COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll" #>
Sorry.
Not sure why this is happening. One of my colleague faced this issue when he is trying to generate database from Model in a common server that we are using. I tried in the same machine with my login from my PC and it worked for first time and i tried again and i got the same error. I just did a
devenv /resetsetting
in VS 2013 command prompt and it worked. Did the same in my colleagues machine and it worked too. Not sure it will workbut wort a try
This worked for me.
Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude
Edit it with Visual Studio.
Remove the two dots after the URL, so the new lines like:
<## assembly name="%VS120COMNTOOLS%\IDE\EntityFramework.dll" #>
<## assembly name="%VS120COMNTOOLS%\IDE\Microsoft.Data.Entity.Design.dll" #>
Fix your environment variables to end with directory just befor IDE. In my case
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\
Rebuild the project or delete the entity framework and recreate it.
Good day guys, Ive encountered this error in the app im working on what I did was:
1. revert the solution/module where the entities,
2. Remove the %VS110COMN%
so the code will look like this
<## assembly name="..\IDE\EntityFramework.dll" #>
<## assembly name="..\IDE\Microsoft.Data.Entity.Design.dll" #>
I know this is late to respond to the question but.
This work For me by following the below steps.
Copy the code form the existing abc.tt file.
Delete the abc.tt file.
Copy all the code again into ABC.tt file.
After copy code just save the file and build the solution it will regenerate the complete .cs file as well.
Try this:
Double Click on the .edmx Model
Right click anywhere on the "Entity Data Model Designer"
Click "Update Model from Database"
Click Finish

Ajax Controls Toolkit and Ajaxmin

I am learning how to use the Ajax Control Toolkit using VB.NET in code-behind in Visual Studio 10.0.40219.1 SP1Rel, .NET 4.0.30319 SP1Rel. I have been to many websites and tried lots of code, using the AnimationExtender. The sample that came with the toolkit works perfectly, but on
http://localhost:1049/
which is different from my "view code in browser" url:
http://localhost:4258/
When I change the url to mine, I get this error:
Could not load file or assembly 'AjaxMin, Version=4.97.4951.28478, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f' or one of its dependencies. The system cannot find the file specified.
Nothing in the installation instructions mentions this. I can't run the page I'm using to learn how to use the AnimationExtender. I am at a loss, and I can't find anything like this on Google or here.
Thanks!
Matty's suggestion to check the sample project sent me back to the directory where I'd unzipped it, then checked the file AjaxControlToolkit.Binary.NET40.zip, which had the AjaxMin.dll file in it. I had admin move the file to C:\Program Files\Microsoft Visual Studio 10.0\VB\Bin (I don't know if that directory matters, it works for me), then in VS added the DLL as a reference to the project. The few errors I've gotten since are nothing to do with ajaxmin.
I had the same problem, I had to copy the file AjaxMin.dll from where I extracted the AjaxControlToolkit.Binary.NET40.zip, to my project's bin folder. i.e. C:\Users\MyUserName\Documents\Visual Studio 2010\Projects\MyProject\MyProject\bin
Rebuilt the solution and this time worked fine..
Hope that will help you :)