I am working on a SSIS Package using SQL Server 2012 and Visual Studio 2010 Shell.
I need to use a web method in a script task I have and I was able to run this script on windows 7 without any problems. This web service requires a certificate which I have installed in my personal computer store.
However when I moved this project into Windows Server 2008 R2, the package breaks for apparently no reason. I have no compilation errors on the Error List and if build the script task it will succeed, however when I finish editing the script a message box will appear with this error message:
"Scripts contained in the package have compilation errors. Do you want to save changes?"
If I remove the web reference from the script task, this message wont appear.
The package won't run because of this. I checked for error details on the Event Viewer, but it only shows "Package Failed" and no further details appear about this issue. Could this be related to a certificate issue? Is there an error log or way to know more details about what is causing the package to fail?
Thank you.
It isn't just the security issue of certificates required by the web service itself that you have to worry about.
The SSRS web server will not allow loading assemblies that are marked as "unsafe"--which is pretty much anything that does I/O. I once added a reference to a .Net Forms assembly to an SSRS report in order to use its rich text functionality. It worked beautifully in Visual Studio, but once deployed to the SSRS web server, it would never run. I am certain it could be made to function, but due to other priorities I actually gave up the job as everything I tried didn't work.
Searching online for adding custom assemblies yields some useful information for getting custom assemblies working. Here are some of the crucial steps:
Sign the assembly with a strong name, required because it is deployed to the GAC.
Use the assembly-level attribute [assembly:AllowPartiallyTrustedCallers] in the assembly so SSRS can use it.
A couple of likely resources are here and here.
Related
I'm trying to publish a project to an Azure Web App via Visual Studio 2015. This is an MVC 4 targeting Framework 4.6.2. The publish procedure claims in VS2015 to have finished successfully, however, when the browser is launched to display the published site, it errors out with a 502 error (bad gateway/proxy) on the favicon.ico file. Obviously, that's not what's really happening.
I downloaded my eventlog.xml file from the Web App and looking at the error being reported, it's claiming that it's unable to find assembly 'EntityFramework, Version=6.0.0.0...'. However, I see the EntityFramework.dll contained within the project bin folder. But, just to see if it made any difference, I tried using Kudu to install EntityFramework from NuGet, as well as doing a nuget restore using the packages.config file that was successfully pushed up to Azure. All that did was restore a ton of files where I didn't need and the same error remains.
Has anyone else seen this issue and have any recommendations on how to resolve it? I'm not sure what else I can post to give a clearer picture of what's going one...it's not like there's any code or source, and the eventlog.xml file shows little more than the YSOD error message for a missing assembly.
Please, any assistance would be greatly appreciated!
I've had this in the past - if you read the error message carefully it says it can't load that assembly or some of its dependencies - so it may well be another dll that's missing from your application.
Use the Console blade in the portal (or the separate Kudu site and console if you prefer) to compare the bin folder contents with that on your dev/test environment and see what's missing - if you stick to using nuget packages then you shouldn't be able to go far wrong, but I think I still had problems a while ago with EF when I didn't reference the EF libraries directly from the web app, but only from a repository assembly that was referenced from the web app.
If you're not using Nuget and referencing the dependencies directly make sure the referenced dll's "copy to output" properties in VS are set correctly, such that the dll's end up being copied to your project's bin folder and included in the package that gets deployed to Azure.
Well, it turns out this one was one of those "that's not the real issue" error messages. Thanks to Russell and Karel. You input led me to verify a few things and make sure I had all things referenced properly.
Here's what I found out...our DEV SQL VM is turned off on the weekends to conserve resources (aka $$$). After sending all files from my local bin directory via FTP, I browsed to the site and received the same error. Downloading the logs, however, showed that I couldn't reach the db server using Named Pipes. Whoops...one of the connection strings (in the repository project) had not been set to the FQDN, so it wasn't using TCP/IP for the connection.
I fixed that, published the site, turned ON the sql server, and now the site is working as expected.
Moral of the story, make sure you have all connection strings set properly.
First of all, thank you everybody for all you do for the community, I have found so many answers on this forum.
I am working on a Large winforms project that connects to a WCF server.
I am using Visual Studio 2015 and .NET 4.0.
As of this morning, when I do a build on our Nant Build Server (Windows Server 2003), and update my test application I am getting a "Common Language Runtime detected an invalid program" once I click my Login button.
So the App Loads, the Main Form loads but this is thrown when I click Login.
However, if I build and debug the App locally, I am able to run the application just fine.
Unfortunately, I did not setup the Build server as I have come in after the Architects and am in charge of Maintenance and Updating.
The differences between the last build that worked and the current build are very minute.
I removed a PictureBox, renamed a Tab, Updated some DLLs that link to the Server after adding another Server Call.
I know the Server is working correctly because I am pointing to the same server when I am Debugging or running the Downloaded App.
Thank you so much, and I will be happy to provide you with any more information!
I am using visual studio 2010 on .net4.0 for my projects and I've found that each time I do a change in my project, I build and run but I cannot see my changes. I've found this happening once or twice mostly with my web service projects. I'm no pro with web services and am encountering this problem for the first time so would be grateful to anybody who can tell me what has gone wrong with my project and how to fix it.
Edit
My asmx file is where I have added an additional method but am not able to see it when I run F5
When you change the compiled code in a web service or site, you need to make sure you restart the web server hosting that service or site.
You are probably using the ASP.Net Development Server. Although Visual Studio starts this server for you, it does not restart it automatically when you rebuild. As a result, the server will still be referencing the previous version of the assembly that you changed.
In the Windows system tray you should see one or more icons depicting a web page with a purple gear overlapping it at the bottom-left.
There are three of them in this example:
You can stop the server by right-clicking its icon and selecting "Stop". (If you have more than one, you will learn to identify the one you need to stop by recognizing the port number shown in the tooltip when you hover the mouse over the icon.) Visual Studio will restart it when needed.
When you're making changes to a service or site, use this workflow:
Make code changes
Stop the ASP.Net Development Server
Rebuild the project containing the changes
Run
Client-side code vs. Server-side code
If you're changing client-side code (HTML or JavaScript), then you may need to force your web browser to refresh its cache. In Windows this is normally done by pressing CTRL+F5 in the browser (see refreshyourcache.com/en/cache for more info). If you're changing compiled code (C#), and restarting the server doesn't help, try restarting Visual Studio, then do Build -> Clean Solution, then Rebuild.
If you are facing issues in ASP.Net Development Server, I think you are better off creating a virtual directory in IIS and host your web service there. That way you should be able to make your changes, just build it (don't run it) and that should be available on your virtual directory and you just browse to webservice. Then you don't have to hit F5 again and again and don't have to worry about instances of ASP.NET dev server.
Following article contains good step-by-step instructions on how you do it on IIS 7.0. This article is about hosting a website - however, hosting a webservice is not different.
http://www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0
All,
I created a C# console app in VS2010 (.NET4). that hits a database and sends out emails.
It works fine when I run it from VS but deploying the app to a remote server has me befuddled. All I need to do is install this app on (1) remote windows server.
Should be easy, right?
Looking at the publish settings, I don't see anything that will just build it locally without creating an installer (From a CD-Rom or DVD-ROM) and the other 2 options really don't apply either, at least by their descriptions.
So here is what I did so far:
The VS2010 publishing options that I am given are as follows:
Step #1 Picked option 3
Step #2 Place generated files on remote server
Step #3 Ran the setup installer
Step #4 Get this error
Question
Am I approaching this correctly?
If not, what do I need to do?
Thanks
Notice the error:
The application requires that assembly office Version 12.0.0.0 be installed in the Global Assembly Cache (GAC) first.
Refer to this answer and this MSDN question which contains the answer I have quoted below:
We solved it by going into the Applications Files dialog under the publish tab of the Project's properties and changing the office.dll assembly to Include. It had previously been set to prerequisite (auto). --Dave3182
It looks like your application is leveraging Microsoft Office (2003, I think) COM objects. This will require the same version of Office to be installed on your server.
If you are leveraging Office format files (.doc, .docx, .xls, .xlsx for example), you can look into 3rd party libraries that allow you to create the formatted files without Office installed. If you are just using Outlook to send the emails, you should re-implement the feature using the .NET libraries instead.
When you try and run a .Net 4 ClickOnce application on a machine running .Net 3.5, it pops up the following error:
Unable to install or run this application. This application requires your system
to be updated to Microsoft Common Language Runtime Version 4.0.30319.0.
Please contact your system administrator.
My question is, is there any way to customize the body of this error message, so that I could put in a custom phone number to call, instead of displaying the above?
Note: I can't just include the prerequesites for the user to install, because the user does not have sufficient rights to install it by themselves anyways, hence why I want to add a phone number to our tech support staff in the error message.
Let's think about this: the manifest file launches the deploy file launches the executable, I think the error message is coming from the deploy file as the executable cannot run without the proper framework. Thereby the answer to your question would be no in a traditional sense.
Of course, you can use an existing app or service to customize that kind of error message, but you'd be stuck deploying that system as well. What I don't get is my clickonce apps install the framework for you resolving the problem themselves, if yours don't for some reason, I'd recommend putting an executable of .NET 4 FW on a share and linking people from there.
Another hackish way you can do it, is if your setup is like mine, you have a web page that clickonce installs off, maybe you could check in that web page? You'd have to change from .htm to .aspx, but that's not a problem on an iis server.
Is this an exception you can catch in code? If so, you can just create and throw an exception with your own message.
throw new Exception("your message here");
You can also check the value of Environment.Version on your initialization sequence to see what version of .NET is installed on the system, then display a message accordingly.