首页 \ 问答 \ “官方”将组件部署到GAC的方式?(“Official” Way to deploy Assemblies into the GAC?)

“官方”将组件部署到GAC的方式?(“Official” Way to deploy Assemblies into the GAC?)

我只是想知道 - 如果我需要将程序集部署到GAC中,那么执行此操作的“官方”方式是什么?

目前我们要么手动拖放到c:\ windows \ assembly文件夹中,要么我们使用gacutil.exe。 第一种方式显然不是好的方法(毕竟它是手动过程),而gacutil是SDK的一部分,在生产服务器上不适用于默认情况。

是否有任何Microsoft部署指南?


I just wonder - if I need to deploy an assembly into the GAC, what is the "official" way of doing it?

Currently we either manually drag/drop into the c:\windows\assembly folder or we use gacutil.exe. The first way is obviously not the good one (it's manual process after all), and gacutil is part of the SDK and not available per default on production servers.

Are there any Microsoft deployment Guidelines?


原文:https://stackoverflow.com/questions/968875
更新时间:2023-05-09 21:05

最满意答案

我认为使用scanf()进行所需的验证时会遇到问题。 首先扫描一个字符串,然后将其转换为数字,你会做得更好。 但是scanf()对于char字符串扫描是危险的,因为它的输入长度不受限制,你必须为它提供指向有限长度输入缓冲区的指针。 最好使用fgets(),它允许您限制输入缓冲区长度。

#include <stdio.h>
int main(int argc, char **argv)
{
    double num=-1;
    char input[80]; // arbitrary size buffer
    char* cp, badc; // badc is for detecting extraneous chars in the input
    int n;
    printf("Enter a positive number:");
    while (num < 0)
    {
        cp = fgets(input, sizeof(input), stdin);
        if (cp == input)
        {
            n = sscanf(input, "%lf %c", &num, &badc);
            if (n != 1) // if badc captured an extraneous char
            {
                printf("Error! Please enter a number:");
                num = -1;
            }
            else if (num < 0)
                printf("Error! Please enter a POSITIVE number:");
        }
    }

    printf("num = %f\n", num);

    return 0;
}

I think you'll have problems doing the validation you want using just scanf(). You'll do better to first scan in a string and then convert it to a numeric. But scanf() is dangerous for scanning in char strings, since its input length is not limited and you have to provide it a pointer to a finite-length input buffer. Better to use fgets(), which allows you to limit the input buffer length.

#include <stdio.h>
int main(int argc, char **argv)
{
    double num=-1;
    char input[80]; // arbitrary size buffer
    char* cp, badc; // badc is for detecting extraneous chars in the input
    int n;
    printf("Enter a positive number:");
    while (num < 0)
    {
        cp = fgets(input, sizeof(input), stdin);
        if (cp == input)
        {
            n = sscanf(input, "%lf %c", &num, &badc);
            if (n != 1) // if badc captured an extraneous char
            {
                printf("Error! Please enter a number:");
                num = -1;
            }
            else if (num < 0)
                printf("Error! Please enter a POSITIVE number:");
        }
    }

    printf("num = %f\n", num);

    return 0;
}

相关问答

更多
  • 在绑定上使用ValidationRule可以获得所需的效果,您可以在XAML中以声明方式指定它们,并且可以根据需要将它们设置为自定义和复杂:
  • 我认为使用scanf()进行所需的验证时会遇到问题。 首先扫描一个字符串,然后将其转换为数字,你会做得更好。 但是scanf()对于char字符串扫描是危险的,因为它的输入长度不受限制,你必须为它提供指向有限长度输入缓冲区的指针。 最好使用fgets(),它允许您限制输入缓冲区长度。 #include int main(int argc, char **argv) { double num=-1; char input[80]; // arbitrary size buf ...
  • 当水涨到鼻子的高度以上时,只有那些会活下来,谁知道如何游泳,不是吗? 从技术上讲,我们将使用存储过程来验证登录[作为最佳实践]。在链接中非常清楚,您可以用最少的编码来完成。 如何验证登录并传递userID 更新: 好吧,如果我们想以你的方式做到这一点。 在方法内部的代码中 private void ValidateLogin() { string uname = "Hsakarp";//I have hard-coded the value to m ...
  • 您可以通过制作各种文本框来模拟这种行为,如下所示: 首先创建一个数字或普通的文本框 - 使用多种字体,字体大小,颜色,铃声和口哨 然后编写一个Selection_Change触发器......与您所做的非常相似(注意Insert菜单中的文本框是Shapes() ) Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim MyTB As Shape ' hide all boxes ActiveSheet.Shapes( ...
  • 这是你做的: int choice; char response, Y, N; for (;;) { printf("Choose a shape from the following:\n 1.Sphere\n 2.Cone\n 3.Cylinder\n"); scanf("%d",&choice); if(choice==1||choice==2||choice==3) { break; } printf ...
  • 你没有得到studentFinalGrades,因为你从不将它存储在任何地方。 你做了一个名为check_letterGrade的函数,它返回一个包含成绩的单个char 。 但是,当您从main调用该函数时,您绝对不会使用该返回值做任何事情。 我怀疑你的意思是写一些类似于: a[i].studentFinalGrade = check_letterGrade(); 您还需要更改结构的定义。 在那里你将studentFinalGrade定义为char[50] ,但你可能只是指char因为你只需要一个字母,对 ...
  • 首先测试cin.fail,然后打印一次消息,然后处理并清除循环中的字符。 这将解释人们输入的“bbb”,这将触发循环中的三次运行,但它只会给你一条消息: if (cin.fail()) { cout << "Enter only an integer please." << endl; } //data type validation while (cin.fail()) { cin.clear(); cin.i ...
  • 这是我的经验,我希望它符合最佳实践。 首先,让我提一下,我通常在我完全控制的情况下工作,并且不会像@tom提到的那样构建我自己的UI。 一般来说,如果您的程序在任何时候很有可能获得垃圾输入,那么值得检查它们。 我通常会做出一些权衡以决定是否应该检查我的输入: 开发时间与调试时间 如果错误的输入很难调试(例如,因为它们不会导致错误而只是不良结果),平衡通常会支持检查,否则不支持。 如果您不确定最终(重新)使用代码的位置,则可能有助于强制执行输入所需的任何假设。 开发时间与运行时体验 如果您的代码需要一个小时才 ...
  • 您可能只想使用Attributes来指定验证规则。 这是存在所有基本验证的命名空间: ComonpentModel.DataAnnotations 。 如果你想变得更加漂亮,这个NuGet包为你提供了许多额外的属性: Data Annotation Extensions 。 这两个都支持客户端验证与ASP.NET的MVC不显眼的验证。 You probably want to just use Attributes to specify your validation rules. This is the ...
  • 为什么不添加新类并将其作为静态方法,以便可以从应用程序的任何位置调用它? 例如: public static class DateTimeHelpers { static bool IsValidSqlDateTimeNative(string someval) { bool valid = false; DateTime testDate = DateTime.MinValue; System ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。